miniupnpd:

- restart miniupnpd on hotplug event if it is enabled but not running
	- remove duplicate scan_interfaces


git-svn-id: svn://svn.openwrt.org/openwrt/packages@13743 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2008-12-25 03:46:04 +00:00
parent 3b70e33939
commit 8217fca3a6
2 changed files with 13 additions and 10 deletions

View File

@ -1,14 +1,18 @@
#!/bin/sh #!/bin/sh
/etc/init.d/miniupnpd enabled && killall -0 miniupnpd 2>/dev/null && { /etc/init.d/miniupnpd enabled && {
. /lib/miniupnpd/firewall.sh killall -0 miniupnpd 2>/dev/null && {
. /lib/miniupnpd/firewall.sh
[ "$ACTION" = "ifup" ] && { [ "$ACTION" = "ifup" ] && {
upnp_firewall_delif upnp_firewall_delif
upnp_firewall_addif upnp_firewall_addif
} }
[ "$ACTION" = "ifdown" ] && { [ "$ACTION" = "ifdown" ] && {
upnp_firewall_delif upnp_firewall_delif
}
} || {
/etc/init.d/miniupnpd restart
} }
} }

View File

@ -17,7 +17,6 @@ start() {
config_get download config download config_get download config download
config_get_bool logging config log_output 0 config_get_bool logging config log_output 0
scan_interfaces
config_get extif ${extif:-wan} ifname config_get extif ${extif:-wan} ifname
if [ -n "$extif" ]; then if [ -n "$extif" ]; then
@ -41,7 +40,7 @@ start() {
if [ "$logging" = "1" ]; then if [ "$logging" = "1" ]; then
eval start-stop-daemon -S -x miniupnpd -- $args -d | logger -t miniupnpd & eval start-stop-daemon -S -x miniupnpd -- $args -d | logger -t miniupnpd &
else else
eval start-stop-daemon -S -x miniupnpd -- $args eval start-stop-daemon -S -x miniupnpd -- $args 2>/dev/null
fi fi
else else
logger -t "upnp daemon" "external interface not found, not starting" logger -t "upnp daemon" "external interface not found, not starting"