4dd2df056199ca05d122e17546386bbb87794449
[openwrt/svn-archive/archive.git] / net / miniupnpd / files / miniupnpd.init
1 #!/bin/sh
2 upnpd_enabled=$(nvram get upnp_enabled)
3 if [ "$upnpd_enabled" = "1" ]; then
4 echo "miniupnpd starting ..."
5 iptables_flush.sh 2>&- >&-
6 killall miniupnpd 2>&-
7 iptables_removeall.sh 2>&- >&-
8 iptables_init.sh
9 upnpd_log=$(nvram get upnpd_log_output)
10 if [ "$upnpd_log" = "1" ]; then
11 miniupnpd -i $(nvram get wan_ifname) -a $(nvram get lan_ipaddr) -p 5000 -U -d | logger -t miniupnpd &
12 else
13 miniupnpd -i $(nvram get wan_ifname) -a $(nvram get lan_ipaddr) -p 5000 -U
14 fi
15 else
16 echo "miniupnpd service is disabled. Set nvram upnp_enabled to '1' to enable."
17 fi