miniupnpd:
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 25 Dec 2008 03:46:04 +0000 (03:46 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 25 Dec 2008 03:46:04 +0000 (03:46 +0000)
- restart miniupnpd on hotplug event if it is enabled but not running
- remove duplicate scan_interfaces

SVN-Revision: 13743

net/miniupnpd/files/miniupnpd.hotplug
net/miniupnpd/files/miniupnpd.init

index 1e76480..2d4a407 100644 (file)
@@ -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
        }
 }
index 1131fd8..9a5b586 100644 (file)
@@ -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"