1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Remove startup delay and rename config of Nginx-ha

This commit is contained in:
Ycarus 2018-06-26 14:41:35 +02:00
parent 5f882b75ae
commit b82d337a68
3 changed files with 7 additions and 25 deletions

View file

@ -1,16 +1,14 @@
config general 'ShadowSocks'
config nginxha 'ShadowSocks'
option enable '0'
option retries '1'
option timeout '1000'
option listen '0.0.0.0:65101'
option startup_delay '5'
list upstreams '1.2.3.4:65101 weight=1 max_fails=3 fail_timeout=30s'
config general 'VPN'
config nginxha 'VPN'
option enable '0'
option retries '1'
option timeout '1000'
option listen '0.0.0.0:65001'
option startup_delay '5'
list upstreams '1.2.3.4:65001 weight=1 max_fails=3 fail_timeout=30s'

View file

@ -20,11 +20,10 @@ _err() {
}
validate_section() {
uci_validate_section nginx-ha general "${1}" \
uci_validate_section nginx-ha nginxha "${1}" \
'enable:bool:0' \
'retries:uinteger:3' \
'timeout:uinteger:4000' \
'startup_delay:uinteger:5' \
'listen:string' \
'upstreams:list(string)'
}
@ -33,12 +32,6 @@ genline_srv(){
echo " server $1;"
}
boot() {
local delay=$(uci -q get $NAME.general.startup_delay)
(sleep ${delay:-0} && start >/dev/null 2>&1) &
return 0
}
start_instance() {
local enable retries timeout startup_delay listen upstreams
@ -69,7 +62,7 @@ start_instance() {
start_service() {
local stream=""
config_load nginx-ha
config_foreach start_instance general
config_foreach start_instance nginxha
[ -z "$stream" ] && return