From 0a714560fbd7af8bbb998ce428956ff8ac3d55a0 Mon Sep 17 00:00:00 2001 From: jow Date: Sun, 5 Feb 2012 15:31:29 +0000 Subject: [PATCH] [packages_10.03.2] ndyndns: merge r29064 git-svn-id: svn://svn.openwrt.org/openwrt/branches/packages_10.03.2@30224 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/ndyndns/Makefile | 20 ++++++++++++-------- net/ndyndns/files/ndyndns.default | 3 --- net/ndyndns/files/ndyndns.init | 19 +++++++++++-------- 3 files changed, 23 insertions(+), 19 deletions(-) delete mode 100644 net/ndyndns/files/ndyndns.default diff --git a/net/ndyndns/Makefile b/net/ndyndns/Makefile index 09f6346..d846504 100644 --- a/net/ndyndns/Makefile +++ b/net/ndyndns/Makefile @@ -1,8 +1,15 @@ +# +# Copyright (C) 2008-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + include $(TOPDIR)/rules.mk PKG_NAME:=ndyndns PKG_VERSION:=2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://ndyndns.googlecode.com/files @@ -33,18 +40,15 @@ endef define Package/ndyndns/conffiles /etc/ndyndns/ndyndns.conf.sample -/etc/default/ndyndns endef define Package/ndyndns/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ndyndns $(1)/usr/sbin - $(INSTALL_DIR) $(1)/etc/default - $(INSTALL_BIN) files/$(PKG_NAME).default $(1)/etc/default/$(PKG_NAME) + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ndyndns $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/init.d/ - $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) - $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) - $(INSTALL_CONF) files/$(PKG_NAME).conf.sample $(1)/etc/$(PKG_NAME) + $(INSTALL_BIN) files/ndyndns.init $(1)/etc/init.d/ndyndns + $(INSTALL_DIR) $(1)/etc/ndyndns + $(INSTALL_CONF) files/ndyndns.conf.sample $(1)/etc/ndyndns endef $(eval $(call BuildPackage,ndyndns)) diff --git a/net/ndyndns/files/ndyndns.default b/net/ndyndns/files/ndyndns.default deleted file mode 100644 index 1904794..0000000 --- a/net/ndyndns/files/ndyndns.default +++ /dev/null @@ -1,3 +0,0 @@ -CHROOT="/etc/ndyndns" -CONFIG="/etc/ndyndns/ndyndns.conf" -OPTIONS="" diff --git a/net/ndyndns/files/ndyndns.init b/net/ndyndns/files/ndyndns.init index 113d19c..3373d99 100644 --- a/net/ndyndns/files/ndyndns.init +++ b/net/ndyndns/files/ndyndns.init @@ -1,18 +1,21 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2011 OpenWrt.org START=80 -DEFAULT=/etc/default/ndyndns -start() { - [ -f $DEFAULT ] && . $DEFAULT +include /lib/network - . /etc/functions.sh - include /lib/network +start() { scan_interfaces - /usr/sbin/ndyndns -c $CHROOT -f $CONFIG -i $(config_get wan ifname) $OPTIONS + config_get wan_if 'wan' 'ifname' + [ -n "$wan_if" ] || return 1 + [ -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 } stop() { - killall ndyndns + service_stop /usr/sbin/ndyndns } -- 2.11.0