Install hosplug script as well
[openwrt/svn-archive/archive.git] / net / linuxigd / files / upnpd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3 # Copyright (C) 2006 loswillios
4 START=65
5
6 include /lib/network
7 scan_interfaces
8 config_get WAN wan ifname
9 config_get LAN lan ifname
10
11 start() {
12 echo -n "Starting UPnP: "
13 route add -net 239.0.0.0 netmask 255.0.0.0 $LAN
14 upnpd $WAN $LAN
15 echo "OK"
16 }
17
18 stop() {
19 echo -n "Stopping UPnP: "
20 route del -net 239.0.0.0 netmask 255.0.0.0 $LAN
21 killall upnpd
22 echo "OK"
23 }
24
25 restart() {
26 stop
27 sleep 5
28 start
29 }