From bb9351648890b3821ddecdbb431d29d5d67c0bee Mon Sep 17 00:00:00 2001 From: jow Date: Tue, 29 May 2012 01:30:23 +0000 Subject: [PATCH] [packages] linuxigd: use network.sh to find device names git-svn-id: svn://svn.openwrt.org/openwrt/packages@31972 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/linuxigd/Makefile | 4 ++-- net/linuxigd/files/upnpd.init | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/net/linuxigd/Makefile b/net/linuxigd/Makefile index bfa050459..d4a0a1055 100644 --- a/net/linuxigd/Makefile +++ b/net/linuxigd/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2006-2012 OpenWrt.org # Copyright (C) 2006 loswillios # # This is free software, licensed under the GNU General Public License v2. @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=linuxigd PKG_VERSION:=1.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/linux-igd diff --git a/net/linuxigd/files/upnpd.init b/net/linuxigd/files/upnpd.init index 832768f63..fd627c436 100644 --- a/net/linuxigd/files/upnpd.init +++ b/net/linuxigd/files/upnpd.init @@ -1,25 +1,24 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2006-2012 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 + . /lib/functions/network.sh - [ -n "$lan_if" ] && route add -net 239.0.0.0 netmask 255.0.0.0 $lan_if + network_get_device wan_if 'wan' || return 1 + network_get_device lan_if 'lan' || return 1 + + 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' + . /lib/functions/network.sh service_stop /usr/sbin/upnpd - [ -n "$lan_if" ] && route del -net 239.0.0.0 netmask 255.0.0.0 $lan_if + + network_get_device lan_if 'lan' && \ + route del -net 239.0.0.0 netmask 255.0.0.0 $lan_if }