add hotplug script to restart coova when wan comes up
authorImre Kaloz <kaloz@openwrt.org>
Mon, 24 Mar 2014 11:16:05 +0000 (11:16 +0000)
committerImre Kaloz <kaloz@openwrt.org>
Mon, 24 Mar 2014 11:16:05 +0000 (11:16 +0000)
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
SVN-Revision: 40015

net/coova-chilli/Makefile
net/coova-chilli/files/chilli.hotplug [new file with mode: 0644]

index 364bb38886c5a22a949771eec2c0516a8ca24cce..fc9c8fa2d2d7c5621240b2316c3a3fd2a402e56f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coova-chilli
 PKG_VERSION:=1.3.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://ap.coova.org/chilli
@@ -79,6 +79,8 @@ define Package/coova-chilli/install
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
        $(INSTALL_DIR) $(1)/etc/chilli
        $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+       $(INSTALL_DATA) ./files/chilli.hotplug $(1)/etc/hotplug.d/iface/30-chilli
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/usr/lib/
diff --git a/net/coova-chilli/files/chilli.hotplug b/net/coova-chilli/files/chilli.hotplug
new file mode 100644 (file)
index 0000000..e12812b
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ "$ACTION" == "ifup" ] || exit 0
+
+[ "$INTERFACE" = "wan" ] && {
+       /etc/init.d/chilli restart
+}