packages/linuxigd: use new service functions

git-svn-id: svn://svn.openwrt.org/openwrt/packages@29070 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2011-11-13 22:16:09 +00:00
parent e66bfed974
commit 20e3c05181
2 changed files with 15 additions and 19 deletions

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2006 OpenWrt.org # Copyright (C) 2006-2011 OpenWrt.org
# Copyright (C) 2006 loswillios # Copyright (C) 2006 loswillios
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=linuxigd PKG_NAME:=linuxigd
PKG_VERSION:=1.0 PKG_VERSION:=1.0
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/linux-igd PKG_SOURCE_URL:=@SF/linux-igd

View File

@ -1,29 +1,25 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org # Copyright (C) 2006-2011 OpenWrt.org
# Copyright (C) 2006 loswillios # Copyright (C) 2006 loswillios
START=65 START=65
include /lib/network include /lib/network
scan_interfaces
config_get WAN wan ifname
config_get LAN lan ifname
start() { start() {
echo -n "Starting UPnP: " scan_interfaces
route add -net 239.0.0.0 netmask 255.0.0.0 $LAN config_get wan_if 'wan' 'ifname'
upnpd $WAN $LAN config_get lan_if 'lan' 'ifname'
echo "OK" [ -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() { stop() {
echo -n "Stopping UPnP: " scan_interfaces
route del -net 239.0.0.0 netmask 255.0.0.0 $LAN config_get lan_if 'lan' 'ifname'
killall upnpd
echo "OK"
}
restart() { service_stop /usr/sbin/upnpd
stop [ -n "$lan_if" ] && route del -net 239.0.0.0 netmask 255.0.0.0 $lan_if
sleep 5
start
} }