From: jow Date: Sun, 5 Feb 2012 15:02:01 +0000 (+0000) Subject: [packages_10.03.2] autossh: merge r28018, r29072, r29199 X-Git-Url: http://git.archive.openwrt.org/?a=commitdiff_plain;h=58817d6b36c1acb28db55fd7c21e2c99e954cdaa;p=10.03%2Fpackages.git [packages_10.03.2] autossh: merge r28018, r29072, r29199 git-svn-id: svn://svn.openwrt.org/openwrt/branches/packages_10.03.2@30194 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/net/autossh/Makefile b/net/autossh/Makefile index c207ffe..70c4c76 100644 --- a/net/autossh/Makefile +++ b/net/autossh/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2008 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autossh PKG_VERSION:=1.4b -PKG_RELEASE:=2 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz PKG_SOURCE_URL:=http://www.harding.motd.ca/autossh/ @@ -43,4 +43,8 @@ define Package/autossh/install $(INSTALL_DATA) ./files/autossh.hotplug $(1)/etc/hotplug.d/iface/20-autossh endef +define Package/autossh/conffiles +/etc/config/autossh +endef + $(eval $(call BuildPackage,autossh)) diff --git a/net/autossh/files/autossh.config b/net/autossh/files/autossh.config index 2e430a0..6ec3238 100644 --- a/net/autossh/files/autossh.config +++ b/net/autossh/files/autossh.config @@ -1,4 +1,5 @@ config autossh option ssh '-i /etc/dropbear/id_rsa -N -T -R 2222:localhost:22 user@host' + option gatetime '0' option monitorport '20000' option poll '600' diff --git a/net/autossh/files/autossh.init b/net/autossh/files/autossh.init index e873de8..b9b1afe 100644 --- a/net/autossh/files/autossh.init +++ b/net/autossh/files/autossh.init @@ -1,14 +1,19 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2011 OpenWrt.org + START=80 -start_service () { +start_instance() { local section="$1" - config_get ssh "$section" ssh - config_get monitorport "$section" monitorport - config_get poll "$section" poll - AUTOSSH_POLL=${poll:-"600"} autossh -M ${monitorport:-"20000"} -f ${ssh} + config_get ssh "$section" 'ssh' + config_get gatetime "$section" 'gatetime' + config_get monitorport "$section" 'monitorport' + config_get poll "$section" 'poll' + + AUTOSSH_GATETIME="${gatetime:-30}" \ + AUTOSSH_POLL="${poll:-600"}" \ + service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh} } boot() { @@ -16,10 +21,10 @@ boot() { } start() { - config_load "autossh" - config_foreach start_service autossh + config_load 'autossh' + config_foreach start_instance 'autossh' } stop() { - killall autossh + service_stop /usr/sbin/autossh }