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 rob@blue-wave.net
This commit is contained in:
parent
9892ca6036
commit
efc34e8501
1 changed files with 20 additions and 0 deletions
|
@ -251,6 +251,26 @@ create_instance() {
|
|||
start_service() {
|
||||
include /lib/functions
|
||||
|
||||
if ! uci get firewall.nodogsplash2.path &> /dev/null ; then
|
||||
if [ -f '/etc/nodogsplash/ndshook.sh' ] ; then
|
||||
rm /etc/nodogsplash/ndshook.sh
|
||||
fi
|
||||
uci delete firewall.nodogsplash2 2> /dev/null
|
||||
uci set firewall.nodogsplash2=include
|
||||
uci set firewall.nodogsplash2.type=script
|
||||
uci set firewall.nodogsplash2.path='/etc/nodogsplash/ndshook.sh'
|
||||
uci commit firewall
|
||||
/etc/init.d/firewall restart 2>&1 | logger
|
||||
fi
|
||||
|
||||
if [ ! -f '/etc/nodogsplash/ndshook.sh' ] ; then
|
||||
printf "#NDS Restart Hook Created by Nodogsplash. Do not modify.\n" > /etc/nodogsplash/ndshook.sh
|
||||
printf " if /usr/bin/ndsctl status > /dev/null; then\n" >> /etc/nodogsplash/ndshook.sh
|
||||
printf " echo \" * Restarting NodogSplash \"\n" >> /etc/nodogsplash/ndshook.sh
|
||||
printf " /etc/init.d/nodogsplash restart\n fi\n" >> /etc/nodogsplash/ndshook.sh
|
||||
chmod +x /etc/nodogsplash/ndshook.sh
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/etc/
|
||||
config_load nodogsplash
|
||||
|
||||
|
|
Loading…
Reference in a new issue