3 /etc
/init.d
/miniupnpd enabled ||
exit 0
5 .
/lib
/functions
/service.sh
7 # If miniupnpd is not running:
8 # - check on _any_ event (even updates may contribute to network_find_wan*)
10 # If miniupnpd _is_ running:
11 # - check only on ifup (otherwise lease updates etc would cause
12 # miniupnpd state loss)
14 [ ! "$ACTION" = "ifup" ] && service_check
/usr
/sbin
/miniupnpd
&& exit 0
18 local tmpconf
="/var/etc/miniupnpd.conf"
19 local extiface
=$
(uci get upnpd.config.external_iface
)
20 local extzone
=$
(uci get upnpd.config.external_zone
)
22 .
/lib
/functions
/network.sh
24 for iface
in $
(uci get upnpd.config.internal_iface
); do
25 network_get_device device
$iface
26 [ "$DEVICE" = "$device" ] && /etc
/init.d
/miniupnpd restart
&& exit 0
30 if [ -z "$extiface" ] ; then
31 # manual external zone (if dynamically find interfaces
32 # belonging to it) overrides network_find_wan*
33 if [ -n "$extzone" ] ; then
34 ifname
=$
(fw3
-q zone
$extzone |
head -1)
36 [ -n "$extiface" ] || network_find_wan extiface
37 [ -n "$extiface" ] || network_find_wan6 extiface
40 [ -n "$ifname" ] || network_get_device ifname
${extiface}
41 grep -q "ext_ifname=$ifname" $tmpconf ||
/etc
/init.d
/miniupnpd restart