From: Florian Fainelli Date: Wed, 8 Feb 2006 14:07:46 +0000 (+0000) Subject: Added hotplug script for ez-ipupdate, checks if user configuration directive is prope... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=01fd24925a4537a5bc812901784cd207abc48c35;p=openwrt%2Fsvn-archive%2Farchive.git Added hotplug script for ez-ipupdate, checks if user configuration directive is properly set SVN-Revision: 3188 --- diff --git a/openwrt/package/ez-ipupdate/Makefile b/openwrt/package/ez-ipupdate/Makefile index fd1a9719ba..615def3660 100644 --- a/openwrt/package/ez-ipupdate/Makefile +++ b/openwrt/package/ez-ipupdate/Makefile @@ -46,8 +46,9 @@ $(PKG_BUILD_DIR)/.built: touch $@ $(IPKG_EZIPUPDATE): - mkdir -p $(IDIR_EZIPUPDATE)/usr/sbin - cp $(PKG_BUILD_DIR)/ez-ipupdate $(IDIR_EZIPUPDATE)/usr/sbin/ + mkdir -p $(IDIR_EZIPUPDATE)/usr/sbin $(IDIR_EZIPUPDATE)/etc/hotplug.d/iface + cp $(PKG_BUILD_DIR)/$(PKG_NAME) $(IDIR_EZIPUPDATE)/usr/sbin/ + cp ./files/$(PKG_NAME).hotplug $(IDIR_EZIPUPDATE)/etc/hotplug.d/iface/10-$(PKG_NAME) $(STRIP) $(IDIR_EZIPUPDATE)/usr/sbin/* $(IPKG_BUILD) $(IDIR_EZIPUPDATE) $(PACKAGE_DIR) diff --git a/openwrt/package/ez-ipupdate/files/ez-ipupdate.conf b/openwrt/package/ez-ipupdate/files/ez-ipupdate.conf new file mode 100644 index 0000000000..ac2d2ce7d2 --- /dev/null +++ b/openwrt/package/ez-ipupdate/files/ez-ipupdate.conf @@ -0,0 +1,8 @@ +service-type=zoneedit +user=myname:mypassword +interface=WAN_IFNAME +host=mydomain.com + +# Do not change the lines below +cache-file=/tmp/ez-ipup +pid-file=/var/run/ez-ipupdate.pid diff --git a/openwrt/package/ez-ipupdate/files/ez-ipupdate.hotplug b/openwrt/package/ez-ipupdate/files/ez-ipupdate.hotplug new file mode 100644 index 0000000000..56a054b4ac --- /dev/null +++ b/openwrt/package/ez-ipupdate/files/ez-ipupdate.hotplug @@ -0,0 +1,6 @@ +PGM=ez-ipupdate +[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && { + [ -e /etc/$PGM.conf ] && { + [ -n $(grep "user=" /etc/$PGM.conf | cut -d= -f2 | cut -d: -f1) ] && [ -n $(grep "user=" /etc/$PGM.conf | cut -d= -f2 | cut -d: -f2) ] && /usr/sbin/$PGM -c /etc/$PGM.conf & + } +}