]> git.99rst.org Git - openwrt-packages.git/commitdiff
watchcat: clarify recovery timer baseline
authorDharmik Parmar <redacted>
Wed, 24 Jun 2026 17:07:18 +0000 (22:37 +0530)
committerJosef Schlehofer <redacted>
Wed, 1 Jul 2026 11:59:43 +0000 (13:59 +0200)
Keep the default restart timing based on the moment the recovery action
is triggered.

The optional reset_failure_timer path still starts a fresh failure window
after the recovery action finishes. This makes the two timing modes
explicit.

Signed-off-by: Dharmik Parmar <redacted>
utils/watchcat/Makefile
utils/watchcat/files/watchcat.sh

index 88fb0bfc7d44b83e4defd4e463958268147fad82..d43f1d21e9e0afd2c5f1dc3b27410b66a87c87e0 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=watchcat
 PKG_VERSION:=1
-PKG_RELEASE:=23
+PKG_RELEASE:=24
 
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 PKG_LICENSE:=GPL-2.0
index a5f40628385a92a655cae72bd3699f4e3f2ef037..e0ecb5cf88a4d516bb919758462a09c57546250b 100644 (file)
@@ -169,6 +169,8 @@ watchcat_monitor_network() {
                done
 
                [ "$((time_now - time_lastcheck_withinternet))" -ge "$failure_period" ] && {
+                       recovery_started="$time_now"
+
                        if [ "$script" != "" ]; then
                                watchcat_run_script "$script" "$iface"
                        else
@@ -188,8 +190,10 @@ watchcat_monitor_network() {
                                time_now="$(cat /proc/uptime)"
                                time_now="${time_now%%.*}"
                                time_lastcheck="$time_now"
+                               time_lastcheck_withinternet="$time_now"
+                       else
+                               time_lastcheck_withinternet="$recovery_started"
                        fi
-                       time_lastcheck_withinternet="$time_now"
                }
 
        done
git clone https://git.99rst.org/PROJECT