packages/net/linuxigd/files/upnpd.init
nico 20e3c05181 packages/linuxigd: use new service functions
git-svn-id: svn://svn.openwrt.org/openwrt/packages@29070 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-11-13 22:16:09 +00:00

26 lines
541 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
# Copyright (C) 2006 loswillios
START=65
include /lib/network
start() {
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
}
stop() {
scan_interfaces
config_get lan_if 'lan' 'ifname'
service_stop /usr/sbin/upnpd
[ -n "$lan_if" ] && route del -net 239.0.0.0 netmask 255.0.0.0 $lan_if
}