[packages] ndyndns: use network.sh to find device names
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 28 May 2012 15:31:06 +0000 (15:31 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 28 May 2012 15:31:06 +0000 (15:31 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@31947 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/ndyndns/Makefile
net/ndyndns/files/ndyndns.init

index d846504..d3ace85 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2011 OpenWrt.org
+# Copyright (C) 2008-2012 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ndyndns
 PKG_VERSION:=2.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://ndyndns.googlecode.com/files
index 3373d99..0ef1ccd 100644 (file)
@@ -1,19 +1,19 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2007-2011 OpenWrt.org
+# Copyright (C) 2007-2012 OpenWrt.org
 
 START=80
 
-include /lib/network
-
 start() {
-       scan_interfaces
-       config_get wan_if 'wan' 'ifname'
-       [ -n "$wan_if" ] || return 1
+       . /lib/functions/network.sh
+
        [ -f /etc/ndyndns/ndyndns.conf ] || {
                echo "$0: missing config file '/etc/ndyndns/ndyndns.conf'" 1>&2
                return 1
        }
-       service_start /usr/sbin/ndyndns -c /etc/ndyndns -f /etc/ndyndns/ndyndns.conf -i $wan_if
+
+       local device
+       network_get_device device wan && \
+               service_start /usr/sbin/ndyndns -c /etc/ndyndns -f /etc/ndyndns/ndyndns.conf -i $device
 }
 
 stop() {