From: florian Date: Sat, 25 Jul 2009 22:06:36 +0000 (+0000) Subject: [package] add autossh hotplug script, remove duplicate restart init script function... X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=ff1d7d7b71f9c8261f51683e98d6ab2d670b32a3;p=packages.git [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 --- diff --git a/net/autossh/Makefile b/net/autossh/Makefile index b34700bf4..c207ffe3e 100644 --- a/net/autossh/Makefile +++ b/net/autossh/Makefile @@ -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 index 000000000..4f695f44c --- /dev/null +++ b/net/autossh/files/autossh.hotplug @@ -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 + } + +} diff --git a/net/autossh/files/autossh.init b/net/autossh/files/autossh.init index faca1c349..e873de807 100644 --- a/net/autossh/files/autossh.init +++ b/net/autossh/files/autossh.init @@ -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 -}