utils/watchcat: restart failure time after network restart
authorRozhuk Ivan <rozhuk.im@gmail.com>
Sun, 20 Feb 2022 05:22:05 +0000 (08:22 +0300)
committerRosen Penev <rosenp@gmail.com>
Thu, 24 Feb 2022 01:28:43 +0000 (17:28 -0800)
Without this change these settings:
Mode: Restart Interface
Period: 30s
Check Interval: 5s
will do ping every 30s, if all pings are fail then
it try to take action every 5 second.

After apply this patch watchcat will try to send
ping every 5 second in next 30 sec before take action if
all pings are fail.

This is important for wireless uplinks like 3G/4G that
need some time to establish connection.

Signed-off-by: Rozhuk Ivan <rozhuk.im@gmail.com>
utils/watchcat/Makefile
utils/watchcat/files/watchcat.sh

index bd0beafff176fb2339579f4e43e737a5239dfb1c..6f2e4cade1e213f7d834aed81d8238ae0fecc44c 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=watchcat
 PKG_VERSION:=1
-PKG_RELEASE:=13
+PKG_RELEASE:=14
 
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 PKG_LICENSE:=GPL-2.0
index 49911848ef3f37d9dcdd16953d28071e74743048..9ee0f6d5683a7d71001ee8d212e1ef14bf4777ea 100644 (file)
@@ -140,6 +140,8 @@ watchcat_monitor_network() {
                                watchcat_restart_all_network
                        fi
                        /etc/init.d/watchcat start
+                       # Restart timer cycle.
+                       time_lastcheck_withinternet="$time_now"
                }
 
        done