mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add option to disable omr-tracker
This commit is contained in:
parent
c4ec834dc9
commit
105653108a
3 changed files with 16 additions and 1 deletions
|
@ -1,6 +1,10 @@
|
|||
config defaults 'defaults'
|
||||
list hosts '4.2.2.1'
|
||||
list hosts '8.8.8.8'
|
||||
list hosts '8.8.4.4'
|
||||
list hosts '9.9.9.9'
|
||||
list hosts '1.1.1.1'
|
||||
list hosts '1.0.0.1'
|
||||
option timeout '1'
|
||||
option tries '4'
|
||||
option interval '2'
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
_validate_section() {
|
||||
local tmp_hosts=$hosts tmp_timeout=$timeout tmp_tries=$tries
|
||||
local tmp_interval=$interval tmp_options=$options tmp_type=$type
|
||||
local tmp_interval=$interval tmp_options=$options tmp_type=$type tmp_enabled=$enabled
|
||||
|
||||
uci_validate_section omr-tracker "$1" "$2" \
|
||||
'hosts:list(host)' \
|
||||
|
@ -19,6 +19,7 @@ _validate_section() {
|
|||
'tries:uinteger' \
|
||||
'interval:uinteger' \
|
||||
'type:string' \
|
||||
'enabled:bool:1' \
|
||||
'options:string'
|
||||
|
||||
[ -z "$hosts" ] && hosts=$tmp_hosts
|
||||
|
@ -27,6 +28,7 @@ _validate_section() {
|
|||
[ -z "$interval" ] && interval=$tmp_interval
|
||||
[ -z "$options" ] && options=$tmp_options
|
||||
[ -z "$type" ] && type=$tmp_type
|
||||
[ -z "$enabled" ] && enabled=$tmp_enabled
|
||||
}
|
||||
|
||||
_launch_tracker() {
|
||||
|
@ -47,6 +49,7 @@ _launch_tracker() {
|
|||
config_get gateway "$1" gateway
|
||||
|
||||
[ -z "$ifname" ] || [ -z "$multipath" ] || [ "$multipath" = "off" ] && [ "$1" != "glorytun" ] && return
|
||||
[ $enabled = 0 ] && return
|
||||
[ -z "$type" ] && type="ping"
|
||||
|
||||
procd_open_instance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue