From a31d0b8e4738f04b2c359009f9503860e5c20937 Mon Sep 17 00:00:00 2001 From: Rob White Date: Wed, 25 Apr 2018 13:48:14 +0100 Subject: [PATCH] nodogsplash2: Add NDS Restart Hook for Firewall nodogsplash2: Add NDS Restart Hook for Firewall NodogSplash iptables entries are overwritten if the OpenWrt Firewall is restarted. This change adds a restart hook to firewall.user to restart NodogSplash if Firewall is restarted. Author-name: Rob White Signed-off-by: Rob White --- nodogsplash2/files/nodogsplash.init | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nodogsplash2/files/nodogsplash.init b/nodogsplash2/files/nodogsplash.init index 32dc1eb..56c78d4 100755 --- a/nodogsplash2/files/nodogsplash.init +++ b/nodogsplash2/files/nodogsplash.init @@ -248,9 +248,23 @@ create_instance() { procd_close_instance } +depends() { + if [ "$1" = "iptables" ] ; then + if $WD_DIR/ndsctl status > /dev/null; then + echo " * Restarting NodogSplash" + /etc/init.d/nodogsplash restart + fi + fi +} + start_service() { include /lib/functions + if [ "$(grep -c "if \[ \-f \'/etc/init.d/nodogsplash\' \] ; " /etc/firewall.user)" = "0" ] ; then + echo "Installing NDS hook for iptables" 2>&1 | logger + printf "\n if [ -f '/etc/init.d/nodogsplash' ] ; then /etc/init.d/nodogsplash depends iptables ; fi\n" >> /etc/firewall.user + fi + mkdir -p /tmp/etc/ config_load nodogsplash