[packages] ndyndns: use network.sh to find device names
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 28 May 2012 15:31:06 +0000 (15:31 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 28 May 2012 15:31:06 +0000 (15:31 +0000)
SVN-Revision: 31947

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

index d846504f8b2b3c5487412c9c3204c6673f2d1bc7..d3ace85748134c7e54935c7d91de1b0c86ea8143 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 3373d997006e5812ee4f2b2606ceb87f40271d01..0ef1ccd9845072dbbfba8208e1de764b1cb1a1eb 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() {