[package] add autossh hotplug script, remove duplicate restart init script function...
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 25 Jul 2009 22:06:36 +0000 (22:06 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 25 Jul 2009 22:06:36 +0000 (22:06 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@16985 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/autossh/Makefile
net/autossh/files/autossh.hotplug [new file with mode: 0644]
net/autossh/files/autossh.init

index b34700b..c207ffe 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=autossh
 PKG_VERSION:=1.4b
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=http://www.harding.motd.ca/autossh/
@@ -39,6 +39,8 @@ define Package/autossh/install
        $(INSTALL_BIN) ./files/autossh.init $(1)/etc/init.d/autossh
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_DATA) ./files/autossh.config $(1)/etc/config/autossh
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+       $(INSTALL_DATA) ./files/autossh.hotplug $(1)/etc/hotplug.d/iface/20-autossh
 endef
 
 $(eval $(call BuildPackage,autossh))
diff --git a/net/autossh/files/autossh.hotplug b/net/autossh/files/autossh.hotplug
new file mode 100644 (file)
index 0000000..4f695f4
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Copyright (C) 2007 OpenWrt.org
+
+/etc/init.d/autossh enabled && {
+
+       [ "$ACTION" = "ifup" ] && {
+               /etc/init.d/autossh start
+       }
+
+       [ "$ACTION" = "ifdown" ] && {
+               /etc/init.d/autossh stop
+       }
+       
+}
index faca1c3..e873de8 100644 (file)
@@ -11,6 +11,10 @@ start_service () {
        AUTOSSH_POLL=${poll:-"600"} autossh -M ${monitorport:-"20000"} -f ${ssh}
 }
 
+boot() {
+       return
+}
+
 start() {
        config_load "autossh"
        config_foreach start_service autossh
@@ -19,8 +23,3 @@ start() {
 stop() {
        killall autossh
 }
-
-restart() {
-       stop
-       start
-}