[package] add autossh hotplug script, remove duplicate restart init script function (#4860)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@16985 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2009-07-25 22:06:36 +00:00
parent 9312abba89
commit ff1d7d7b71
3 changed files with 21 additions and 6 deletions

View 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))

View File

@ -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
}
}

View 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
}