diff options
author | Christian Beier <cb@shoutrlabs.com> | 2016-09-06 13:51:24 +0200 |
---|---|---|
committer | Christian Beier <cb@shoutrlabs.com> | 2016-09-06 13:51:24 +0200 |
commit | 0648e9e71e37f874188bd860d5e402c43b37ea3a (patch) | |
tree | 460546333ff833554c639e2a7eb208b34f456a16 /net/autossh/files | |
parent | 6432150acc4f56b0256b02e2b4da4f4c5e59b7cb (diff) |
autossh: import from oldpackages
Signed-off-by: Christian Beier <cb@shoutrlabs.com>
Diffstat (limited to 'net/autossh/files')
-rw-r--r-- | net/autossh/files/autossh.config | 5 | ||||
-rw-r--r-- | net/autossh/files/autossh.hotplug | 14 | ||||
-rw-r--r-- | net/autossh/files/autossh.init | 30 |
3 files changed, 49 insertions, 0 deletions
diff --git a/net/autossh/files/autossh.config b/net/autossh/files/autossh.config new file mode 100644 index 000000000..6ec323858 --- /dev/null +++ b/net/autossh/files/autossh.config @@ -0,0 +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.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 new file mode 100644 index 000000000..f81bf4d87 --- /dev/null +++ b/net/autossh/files/autossh.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=80 + +start_instance() { + local section="$1" + + config_get ssh "$section" 'ssh' + config_get gatetime "$section" 'gatetime' + config_get monitorport "$section" 'monitorport' + config_get poll "$section" 'poll' + + export AUTOSSH_GATETIME="${gatetime:-30}" + export AUTOSSH_POLL="${poll:-600}" + service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh} +} + +boot() { + return +} + +start() { + config_load 'autossh' + config_foreach start_instance 'autossh' +} + +stop() { + service_stop /usr/sbin/autossh +} |