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
19 # DEVICE is set only in ifup as of 20140625 netifd
20 [ -z "$DEVICE" ] && network_get_device DEVICE
$INTERFACE
26 .
/lib
/functions
/network.sh
27 network_find_wan ext_iface
28 network_find_wan6 ext_iface6
30 for iface
in $ext_iface $ext_iface6 $
(uci_get upnpd config internal_iface
; uci_get upnpd config external_iface
); do
31 network_get_device device
$iface
32 [ "$DEVICE" = "$device" ] && /etc
/init.d
/miniupnpd restart
&& exit 0