From 4c1b3b5dbdc2d3a52df2c2fe8d84f9856c574970 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 25 Dec 2008 03:46:04 +0000 Subject: [PATCH] miniupnpd: - restart miniupnpd on hotplug event if it is enabled but not running - remove duplicate scan_interfaces SVN-Revision: 13743 --- net/miniupnpd/files/miniupnpd.hotplug | 20 ++++++++++++-------- net/miniupnpd/files/miniupnpd.init | 3 +-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/net/miniupnpd/files/miniupnpd.hotplug b/net/miniupnpd/files/miniupnpd.hotplug index 1e7648002c..2d4a4076e1 100644 --- a/net/miniupnpd/files/miniupnpd.hotplug +++ b/net/miniupnpd/files/miniupnpd.hotplug @@ -1,14 +1,18 @@ #!/bin/sh -/etc/init.d/miniupnpd enabled && killall -0 miniupnpd 2>/dev/null && { - . /lib/miniupnpd/firewall.sh +/etc/init.d/miniupnpd enabled && { + killall -0 miniupnpd 2>/dev/null && { + . /lib/miniupnpd/firewall.sh - [ "$ACTION" = "ifup" ] && { - upnp_firewall_delif - upnp_firewall_addif - } + [ "$ACTION" = "ifup" ] && { + upnp_firewall_delif + upnp_firewall_addif + } - [ "$ACTION" = "ifdown" ] && { - upnp_firewall_delif + [ "$ACTION" = "ifdown" ] && { + upnp_firewall_delif + } + } || { + /etc/init.d/miniupnpd restart } } diff --git a/net/miniupnpd/files/miniupnpd.init b/net/miniupnpd/files/miniupnpd.init index 1131fd84be..9a5b586c81 100644 --- a/net/miniupnpd/files/miniupnpd.init +++ b/net/miniupnpd/files/miniupnpd.init @@ -17,7 +17,6 @@ start() { config_get download config download config_get_bool logging config log_output 0 - scan_interfaces config_get extif ${extif:-wan} ifname if [ -n "$extif" ]; then @@ -41,7 +40,7 @@ start() { if [ "$logging" = "1" ]; then eval start-stop-daemon -S -x miniupnpd -- $args -d | logger -t miniupnpd & else - eval start-stop-daemon -S -x miniupnpd -- $args + eval start-stop-daemon -S -x miniupnpd -- $args 2>/dev/null fi else logger -t "upnp daemon" "external interface not found, not starting" -- 2.30.2