#!/sbin/runscript depend() { need net } checkconfig() { if [ "$INTERFACE" = "" -o "$OUTERFACE" = "" ] ; then ewarn "You need to configure upnpd in /etc/conf.d/upnpd" return 1 fi return 0 } start() { checkconfig || return 1 ebegin "Starting upnpd" if [ "$ALLOW_MULTICAST" != "no" ] ; then /sbin/route add -net 239.0.0.0 netmask 255.0.0.0 $INTERFACE fi start-stop-daemon --start \ --exec /usr/sbin/upnpd -- $OUTERFACE $INTERFACE eend $? } stop() { ebegin "Stopping upnpd" if [ "$ALLOW_MULTICAST" != "no" ] ; then /sbin/route del -net 239.0.0.0 netmask 255.0.0.0 $INTERFACE fi start-stop-daemon --stop --exec /usr/sbin/upnpd eend $? }