miniupnpd.init.d.script: also run ip6tables_init/ip6tables_removeall scripts

for support of IPv6
see https://miniupnp.tuxfamily.org/forum/viewtopic.php?t=2338
This commit is contained in:
Thomas Bernard 2023-01-21 13:00:03 +01:00
parent f4a739d730
commit 98cc9f1b43
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
1 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $Id: miniupnpd.init.d.script,v 1.4 2022/02/19 22:45:06 nanard Exp $ # $Id: miniupnpd.init.d.script,v 1.5 2023/01/21 12:08:40 nanard Exp $
# MiniUPnP project # MiniUPnP project
# author: Thomas Bernard # author: Thomas Bernard
# website: http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ # website: http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
@ -22,6 +22,9 @@ ARGS="-f $ETCPATH/miniupnpd.conf"
if [ -f $ETCPATH/nft_init.sh ] ; then if [ -f $ETCPATH/nft_init.sh ] ; then
IPTABLES_CREATE=$ETCPATH/nft_init.sh IPTABLES_CREATE=$ETCPATH/nft_init.sh
IPTABLES_REMOVE=$ETCPATH/nft_removeall.sh IPTABLES_REMOVE=$ETCPATH/nft_removeall.sh
elif [ -f $ETCPATH/ip6tables_init.sh ] ; then
IPTABLES_CREATE="($ETCPATH/iptables_init.sh ; $ETCPATH/ip6tables_init.sh)"
IPTABLES_REMOVE="($ETCPATH/iptables_removeall.sh ; $ETCPATH/iptables_removeall.sh)"
else else
IPTABLES_CREATE=$ETCPATH/iptables_init.sh IPTABLES_CREATE=$ETCPATH/iptables_init.sh
IPTABLES_REMOVE=$ETCPATH/iptables_removeall.sh IPTABLES_REMOVE=$ETCPATH/iptables_removeall.sh
@ -34,7 +37,7 @@ test -f $MINIUPNPD || exit 0
case "$1" in case "$1" in
start) start)
log_daemon_msg "Starting miniupnpd" "miniupnpd" log_daemon_msg "Starting miniupnpd" "miniupnpd"
$IPTABLES_CREATE > /dev/null 2>&1 eval $IPTABLES_CREATE > /dev/null 2>&1
start-stop-daemon --start --quiet --pidfile /var/run/miniupnpd.pid --startas $MINIUPNPD -- $ARGS $LSBNAMES start-stop-daemon --start --quiet --pidfile /var/run/miniupnpd.pid --startas $MINIUPNPD -- $ARGS $LSBNAMES
log_end_msg $? log_end_msg $?
;; ;;
@ -42,13 +45,13 @@ case "$1" in
log_daemon_msg "Stopping miniupnpd" "miniupnpd" log_daemon_msg "Stopping miniupnpd" "miniupnpd"
start-stop-daemon --stop --quiet --pidfile /var/run/miniupnpd.pid start-stop-daemon --stop --quiet --pidfile /var/run/miniupnpd.pid
log_end_msg $? log_end_msg $?
$IPTABLES_REMOVE > /dev/null 2>&1 eval $IPTABLES_REMOVE > /dev/null 2>&1
;; ;;
restart|reload|force-reload) restart|reload|force-reload)
log_daemon_msg "Restarting miniupnpd" "miniupnpd" log_daemon_msg "Restarting miniupnpd" "miniupnpd"
start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/miniupnpd.pid start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/miniupnpd.pid
$IPTABLES_REMOVE > /dev/null 2>&1 eval $IPTABLES_REMOVE > /dev/null 2>&1
$IPTABLES_CREATE > /dev/null 2>&1 eval $IPTABLES_CREATE > /dev/null 2>&1
start-stop-daemon --start --quiet --pidfile /var/run/miniupnpd.pid --startas $MINIUPNPD -- $ARGS $LSBNAMES start-stop-daemon --start --quiet --pidfile /var/run/miniupnpd.pid --startas $MINIUPNPD -- $ARGS $LSBNAMES
log_end_msg $? log_end_msg $?
;; ;;