summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/linux-igd/files/rc_upnpd')
-rw-r--r--net-misc/linux-igd/files/rc_upnpd30
1 files changed, 30 insertions, 0 deletions
diff --git a/net-misc/linux-igd/files/rc_upnpd b/net-misc/linux-igd/files/rc_upnpd
new file mode 100644
index 000000000000..36f2e42c1cc8
--- /dev/null
+++ b/net-misc/linux-igd/files/rc_upnpd
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ source /etc/linuxigd/upnpd.conf
+ if [ "$INTERFACE" = "" -o "$OUTERFACE" = "" ] ; then
+ ewarn "You need to configure upnpd in /etc/linuxigd/upnpd.conf"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || exit
+ ebegin "Starting upnpd"
+ /sbin/route add -net 239.0.0.0 netmask 255.0.0.0 $INTERFACE
+ start-stop-daemon --start \
+ --exec /usr/bin/upnpd -- $OUTERFACE $INTERFACE
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping upnpd"
+ /sbin/route del -net 239.0.0.0 netmask 255.0.0.0 $INTERFACE
+ start-stop-daemon --stop --exec /usr/bin/upnpd
+ eend $?
+}