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 1e7648002c7aea7beee451eb2cba7f577263edfe..2d4a4076e19c456d0f202f5228688fc1ee828191 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 1131fd84be853688397e19aedf021474b1e425f7..9a5b586c8162bbf16ae790ce6689cd03ccfa690c 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"