#
-# 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.
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/
$(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))
#!/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() {
}
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
}