mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add a mode to only ping gateway
This commit is contained in:
parent
bceb352e67
commit
33ddb440b8
2 changed files with 9 additions and 1 deletions
|
@ -23,9 +23,10 @@ o.default = "2"
|
|||
o.datatype = "range(1, 100)"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "type", translate("Type"))
|
||||
o = s:option(ListValue, "type", translate("Type"), translate("Always ping gateway, then test connection by ping or dns. None mode only ping gateway"))
|
||||
o:value("ping","ping")
|
||||
o:value("dns","dns")
|
||||
o:value("none","none")
|
||||
|
||||
o = s:option(DynamicList, "hosts", translate("Hosts"))
|
||||
o.placeholder = "4.2.2.1"
|
||||
|
|
|
@ -108,6 +108,10 @@ _dns() {
|
|||
false
|
||||
}
|
||||
|
||||
_none() {
|
||||
return
|
||||
}
|
||||
|
||||
_restart
|
||||
|
||||
# main loop
|
||||
|
@ -141,6 +145,9 @@ while true; do
|
|||
elif [ "$OMR_TRACKER_TYPE" = "dns" ]; then
|
||||
_dns "$OMR_TRACKER_HOST" "$OMR_TRACKER_DEVICE_IP" "yes"
|
||||
status=$?
|
||||
elif [ "$OMR_TRACKER_TYPE" = "none" ]; then
|
||||
_none
|
||||
status=$?
|
||||
fi
|
||||
if $(exit $status); then
|
||||
OMR_TRACKER_STATUS="OK"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue