From 1e781ddad3406acf1207df674a76ce2c589c737b Mon Sep 17 00:00:00 2001 From: "Sergei S." Date: Mon, 10 Aug 2026 15:36:52 +0400 Subject: [PATCH] watchcat: add per-instance 'enabled' option (default 1) Allows disabling individual watchcat instances without removing them. Signed-off-by: Sergei S. --- utils/watchcat/Makefile | 2 +- utils/watchcat/files/watchcat.config | 2 ++ utils/watchcat/files/watchcat.init | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/watchcat/Makefile b/utils/watchcat/Makefile index ed5d8084903e93..88c7d4350322f8 100644 --- a/utils/watchcat/Makefile +++ b/utils/watchcat/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=watchcat PKG_VERSION:=1 -PKG_RELEASE:=25 +PKG_RELEASE:=26 PKG_MAINTAINER:=Daniel F. Dickinson , Dharmik Parmar PKG_LICENSE:=GPL-2.0 diff --git a/utils/watchcat/files/watchcat.config b/utils/watchcat/files/watchcat.config index 0513d411994264..ef7ad8fb63b793 100644 --- a/utils/watchcat/files/watchcat.config +++ b/utils/watchcat/files/watchcat.config @@ -6,3 +6,5 @@ config watchcat # For restart_iface and run_script, start a fresh failure window after # each recovery action finishes before allowing another restart. # option reset_failure_timer '1' + # 'enabled' allows disabling individual watchcat instances without removing them, default 1 + # option enabled '1' diff --git a/utils/watchcat/files/watchcat.init b/utils/watchcat/files/watchcat.init index 75a8f012457796..2364228eb31519 100644 --- a/utils/watchcat/files/watchcat.init +++ b/utils/watchcat/files/watchcat.init @@ -32,6 +32,9 @@ time_to_seconds() { config_watchcat() { # Read config + config_get_bool enabled "$1" enabled 1 + [ "$enabled" -eq 1 ] || return 0 + config_get period "$1" period "120" config_get mode "$1" mode "ping_reboot" config_get pinghosts "$1" pinghosts "8.8.8.8"