fi
}
-start() {
- type miniupnpd_add_rules >/dev/null 2>/dev/null || \
- ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd
+boot() {
+ return
+}
+start() {
config_load "upnpd"
local extiface intiface upload download logging secure enabled natpmp
local extip port usesysuptime conffile serial_number model_number
local args
- include /lib/network
- scan_interfaces
+ . /lib/functions/network.sh
local ifname
- config_get ifname ${extiface:-wan} ifname
+ network_get_device ifname ${extiface:-wan}
if [ -n "$conffile" ]; then
args="-f $conffile"
local iface
for iface in ${intiface:-lan}; do
- local ipaddr netmask
- config_get ipaddr "$iface" ipaddr
- config_get netmask "$iface" netmask "255.255.255.0"
- [ -n "$ipaddr" ] && \
- echo "listening_ip=$ipaddr/$netmask" >>$tmpconf
+ local device
+ network_get_device device "$iface" && {
+ echo "listening_ip=$device" >>$tmpconf
+ }
done
[ "$port" != "auto" ] && \
if [ -n "$ifname" ]; then
# start firewall
- local zone
- config_load firewall
- config_get zone core "${extiface:-wan}_zone"
-
- [ -n "$zone" ] && \
- miniupnpd_add_rules "$zone" "${extiface:-wan}" "$ifname"
+ iptables -L MINIUPNPD >/dev/null 2>/dev/null || fw3 reload
if [ "$logging" = "1" ]; then
SERVICE_DAEMONIZE=1 \
stop() {
service_stop /usr/sbin/miniupnpd
- type miniupnpd_remove_rules >/dev/null 2>/dev/null || \
- ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd
-
- miniupnpd_remove_rules
-
iptables -t nat -F MINIUPNPD 2>/dev/null
- iptables -t nat -X MINIUPNPD 2>/dev/null
iptables -t filter -F MINIUPNPD 2>/dev/null
- iptables -t filter -X MINIUPNPD 2>/dev/null
}