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