From c3a85b96de31a8aa888443b1c57d31907e8eb74d Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Sun, 5 Apr 2026 11:21:22 -0400 Subject: [PATCH] watchcat: use logical network to fix restart_interface Watchcat was failing to restart layer-3 interfaces when in mode 'restart_iface'. The previously attempted fix made the situation worse in that it resulted in layer 2 interfaces also failing to start. This was because we are passed the interface name (e.g. eth0, l2p0, or br-lan), but ifup needs the logical network (e.g. 'lan' which corresponds to the network device). Update to use find_config from /lib/network/config.sh to find the logical network from the interface name, and use ifup on the logical network to restart the underlying interface(s) associated with the logical network. Signed-off-by: Daniel F. Dickinson --- utils/watchcat/Makefile | 2 +- utils/watchcat/files/watchcat.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/watchcat/Makefile b/utils/watchcat/Makefile index 7ecf6b60e7..b66a237ac5 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:=21 +PKG_RELEASE:=22 PKG_MAINTAINER:=Roger D PKG_LICENSE:=GPL-2.0 diff --git a/utils/watchcat/files/watchcat.sh b/utils/watchcat/files/watchcat.sh index 0de47105cd..5167911fd3 100644 --- a/utils/watchcat/files/watchcat.sh +++ b/utils/watchcat/files/watchcat.sh @@ -6,6 +6,8 @@ # This is free software, licensed under the GNU General Public License v2. # +. /lib/network/config.sh + get_ping_size() { ps=$1 case "$ps" in @@ -82,8 +84,10 @@ watchcat_restart_modemmanager_iface() { } watchcat_restart_network_iface() { - logger -p daemon.info -t "watchcat[$$]" "Restarting network interface: \"$1\"." - ifup "$1" + local network + network="$(find_config "$1")" + logger -p daemon.info -t "watchcat[$$]" "Restarting network interface: \"$1\" (network: \"$network\")." + ifup "$network" } watchcat_run_script() {