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

Add random before WAN check

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-08-27 17:57:51 +02:00
parent 5d246784b5
commit c3dc257a80

View file

@ -428,7 +428,7 @@ fi
#ubus call network reload
# Save wan settings for status page
if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(date +"%s") - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc))) -gt 3600 ]; then
if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(date +"%s") + $((10 + RANDOM % 31)) - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc))) -gt 3600 ]; then
_log "Get status and settings for $OMR_TRACKER_INTERFACE..."
if [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ]; then
local ipaddr="$(omr-ip-intf $OMR_TRACKER_DEVICE)"