2007-01-10 11:41:14 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2011-11-13 22:16:09 +00:00
|
|
|
# Copyright (C) 2006-2011 OpenWrt.org
|
2007-01-10 11:41:14 +00:00
|
|
|
# Copyright (C) 2006 loswillios
|
2011-11-13 22:16:09 +00:00
|
|
|
|
2007-01-10 11:41:14 +00:00
|
|
|
START=65
|
|
|
|
|
|
|
|
include /lib/network
|
|
|
|
|
|
|
|
start() {
|
2011-11-13 22:16:09 +00:00
|
|
|
scan_interfaces
|
|
|
|
config_get wan_if 'wan' 'ifname'
|
|
|
|
config_get lan_if 'lan' 'ifname'
|
|
|
|
[ -n "$wan_if" ] || return 1
|
|
|
|
|
|
|
|
[ -n "$lan_if" ] && route add -net 239.0.0.0 netmask 255.0.0.0 $lan_if
|
|
|
|
service_start /usr/sbin/upnpd $wan_if $lan_if
|
2007-01-10 11:41:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2011-11-13 22:16:09 +00:00
|
|
|
scan_interfaces
|
|
|
|
config_get lan_if 'lan' 'ifname'
|
2007-01-10 11:41:14 +00:00
|
|
|
|
2011-11-13 22:16:09 +00:00
|
|
|
service_stop /usr/sbin/upnpd
|
|
|
|
[ -n "$lan_if" ] && route del -net 239.0.0.0 netmask 255.0.0.0 $lan_if
|
2007-01-10 11:41:14 +00:00
|
|
|
}
|