mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
autossh: import from oldpackages
Signed-off-by: Christian Beier <cb@shoutrlabs.com>
This commit is contained in:
@@ -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'
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user