#!/sbin/runscript # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/linux-igd/files/upnpd.initd-1.0-r2,v 1.2 2008/09/16 06:53:23 vapier Exp $ depend() { need net } checkconfig() { if [ "$INTERNAL_INTERFACE" = "" -o "$EXTERNAL_INTERFACE" = "" ] ; 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" = "yes" ] ; then route add -net 239.0.0.0 netmask 255.0.0.0 $INTERNAL_INTERFACE fi start-stop-daemon --start --exec /usr/sbin/upnpd -- $EXTERNAL_INTERFACE $INTERNAL_INTERFACE eend $? } stop() { ebegin "Stopping upnpd" if [ "$ALLOW_MULTICAST" = "yes" ] ; then route del -net 239.0.0.0 netmask 255.0.0.0 $INTERNAL_INTERFACE fi start-stop-daemon --stop --exec /usr/sbin/upnpd eend $? }