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

Add choice between ping or dns to omr-tracker

This commit is contained in:
Ycarus 2018-03-01 14:56:02 +01:00
parent 7b94b8742e
commit 8eb08542c0
4 changed files with 61 additions and 26 deletions

View file

@ -11,13 +11,14 @@
_validate_section() {
local tmp_hosts=$hosts tmp_timeout=$timeout tmp_tries=$tries
local tmp_interval=$interval tmp_options=$options
local tmp_interval=$interval tmp_options=$options tmp_type=$type
uci_validate_section omr-tracker "$1" "$2" \
'hosts:list(host)' \
'timeout:uinteger' \
'tries:uinteger' \
'hosts:list(host)' \
'timeout:uinteger' \
'tries:uinteger' \
'interval:uinteger' \
'type:string' \
'options:string'
[ -z "$hosts" ] && hosts=$tmp_hosts
@ -25,6 +26,7 @@ _validate_section() {
[ -z "$tries" ] && tries=$tmp_tries
[ -z "$interval" ] && interval=$tmp_interval
[ -z "$options" ] && options=$tmp_options
[ -z "$type" ] && options=$tmp_type
}
_launch_tracker() {
@ -35,9 +37,8 @@ _launch_tracker() {
local interface_type
config_get interface_type "$1" type
local hosts timeout tries interval options
local hosts timeout tries interval options type
_validate_section "defaults" "defaults"
_validate_section "rule_type" "$interface_type"
_validate_section "interface" "$1"
local ifname ip4table