packages/linuxigd: use new service functions
[openwrt/svn-archive/archive.git] / net / linuxigd / files / upnpd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006-2011 OpenWrt.org
3 # Copyright (C) 2006 loswillios
4
5 START=65
6
7 include /lib/network
8
9 start() {
10 scan_interfaces
11 config_get wan_if 'wan' 'ifname'
12 config_get lan_if 'lan' 'ifname'
13 [ -n "$wan_if" ] || return 1
14
15 [ -n "$lan_if" ] && route add -net 239.0.0.0 netmask 255.0.0.0 $lan_if
16 service_start /usr/sbin/upnpd $wan_if $lan_if
17 }
18
19 stop() {
20 scan_interfaces
21 config_get lan_if 'lan' 'ifname'
22
23 service_stop /usr/sbin/upnpd
24 [ -n "$lan_if" ] && route del -net 239.0.0.0 netmask 255.0.0.0 $lan_if
25 }