326ade1d0b
git-svn-id: svn://svn.openwrt.org/openwrt/packages@30349 3c298f89-4303-0410-b956-a3cf2f4a3e73
31 lines
555 B
Bash
31 lines
555 B
Bash
#!/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'
|
|
|
|
AUTOSSH_GATETIME="${gatetime:-30}" \
|
|
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
|
|
}
|