1
0
Fork 0
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:
Ycarus 2018-03-30 11:12:14 +02:00
parent c4ec834dc9
commit 105653108a
3 changed files with 16 additions and 1 deletions

View file

@ -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