Files
packages/utils/watchcat/Makefile
Daniel F. Dickinson c3a85b96de 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 <dfdpublic@wildtechgarden.ca>
2026-04-11 09:13:01 +03:00

49 lines
1.2 KiB
Makefile

#
# Copyright (C) 2010 segal.di.ubi.pt
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=watchcat
PKG_VERSION:=1
PKG_RELEASE:=22
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
define Package/watchcat
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Enable the configuration of programmed reboots or network interface restarts
PKGARCH:=all
endef
define Package/watchcat/description
Restart network interfaces or reboot if pings to hosts fail, or set up periodic reboots. Configured via UCI /etc/config/watchcat
endef
define Package/watchcat/conffiles
/etc/config/watchcat
endef
define Build/Compile
endef
define Package/watchcat/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/watchcat.init $(1)/etc/init.d/watchcat
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./files/watchcat.sh $(1)/usr/bin/watchcat.sh
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/watchcat.config $(1)/etc/config/watchcat
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/migrate-watchcat $(1)/etc/uci-defaults/migrate-watchcat
endef
$(eval $(call BuildPackage,watchcat))