#!/bin/sh

/etc/init.d/miniupnpd enabled && {
	killall -0 miniupnpd 2>/dev/null && {
		. /lib/miniupnpd/firewall.sh

		[ "$ACTION" = "ifup" ] && {
			upnp_firewall_delif
			upnp_firewall_addif
		}

		[ "$ACTION" = "ifdown" ] && {
			upnp_firewall_delif
		}
	} || {
		/etc/init.d/miniupnpd restart
	}
}
