1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 19:41:51 +00:00

Put default values for all sleep in OMR-Tracker

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-01-16 18:38:37 +01:00
parent 08916a7788
commit e9c8954c83
2 changed files with 5 additions and 4 deletions

View file

@ -445,7 +445,7 @@ while true; do
OMR_TRACKER_HOSTS="${OMR_TRACKER_HOSTS#* } $OMR_TRACKER_HOST" OMR_TRACKER_HOSTS="${OMR_TRACKER_HOSTS#* } $OMR_TRACKER_HOST"
} }
#OMR_TRACKER_TIMEOUT=$((OMR_TRACKER_TIMEOUT * 2)) #OMR_TRACKER_TIMEOUT=$((OMR_TRACKER_TIMEOUT * 2))
sleep "$OMR_TRACKER_INTERVAL_TRIES" sleep "${OMR_TRACKER_INTERVAL_TRIES:-1}"
done done
fi fi
#if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" = "0" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then #if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" = "0" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then
@ -550,7 +550,7 @@ while true; do
OMR_TRACKER_HOSTS6="${OMR_TRACKER_HOSTS6#* } $OMR_TRACKER_HOST6" OMR_TRACKER_HOSTS6="${OMR_TRACKER_HOSTS6#* } $OMR_TRACKER_HOST6"
} }
#OMR_TRACKER_TIMEOUT=$((OMR_TRACKER_TIMEOUT * 2)) #OMR_TRACKER_TIMEOUT=$((OMR_TRACKER_TIMEOUT * 2))
sleep "$OMR_TRACKER_INTERVAL_TRIES" sleep "${OMR_TRACKER_INTERVAL_TRIES:-1}"
done done
fi fi
if [ -z "$OMR_TRACKER_DEVICE_IP" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ -z "$OMR_TRACKER_DEVICE_IP6" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then if [ -z "$OMR_TRACKER_DEVICE_IP" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ -z "$OMR_TRACKER_DEVICE_IP6" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then
@ -611,8 +611,8 @@ while true; do
_restart _restart
if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
sleep "$OMR_TRACKER_FAILURE_INTERVAL" sleep "${$OMR_TRACKER_FAILURE_INTERVAL:-5}"
else else
sleep "$OMR_TRACKER_INTERVAL" sleep "${OMR_TRACKER_INTERVAL:-2}"
fi fi
done done

View file

@ -98,6 +98,7 @@ _launch_tracker() {
ifstatus=$(ifstatus "$1" | jsonfilter -q -e '@["up"]') ifstatus=$(ifstatus "$1" | jsonfilter -q -e '@["up"]')
ifdevice=$(ifstatus "$1" | jsonfilter -q -e '@["device"]') ifdevice=$(ifstatus "$1" | jsonfilter -q -e '@["device"]')
#[ "${ifstatus}" = "false" ] && [ -z "${ifdevice}" ] && return #[ "${ifstatus}" = "false" ] && [ -z "${ifdevice}" ] && return
[ -z "${interval}" ] && interval=2
[ -z "${interval_tries}" ] && interval_tries=1 [ -z "${interval_tries}" ] && interval_tries=1
[ -z "${count}" ] && count=2 [ -z "${count}" ] && count=2
[ -z "${max_ttl}" ] && max_ttl=60 [ -z "${max_ttl}" ] && max_ttl=60