|
@ -1,6 +1,7 @@ |
|
|
#!/bin/sh /etc/rc.common |
|
|
#!/bin/sh /etc/rc.common |
|
|
# Copyright (C) 2007-2011 OpenWrt.org |
|
|
# Copyright (C) 2007-2011 OpenWrt.org |
|
|
|
|
|
|
|
|
|
|
|
USE_PROCD=1 |
|
|
START=80 |
|
|
START=80 |
|
|
|
|
|
|
|
|
start_instance() { |
|
|
start_instance() { |
|
@ -14,20 +15,15 @@ start_instance() { |
|
|
|
|
|
|
|
|
[ "$enabled" = 1 ] || exit 0 |
|
|
[ "$enabled" = 1 ] || exit 0 |
|
|
|
|
|
|
|
|
export AUTOSSH_GATETIME="${gatetime:-30}" |
|
|
|
|
|
export AUTOSSH_POLL="${poll:-600}" |
|
|
|
|
|
service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh} |
|
|
|
|
|
|
|
|
procd_open_instance |
|
|
|
|
|
procd_set_param command /usr/sbin/autossh -M ${monitorport:-20000} ${ssh} |
|
|
|
|
|
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} |
|
|
|
|
|
procd_set_param env AUTOSSH_GATETIME="${gatetime:-30}" |
|
|
|
|
|
procd_set_param env AUTOSSH_POLL="${poll:-600}" |
|
|
|
|
|
procd_close_instance |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
boot() { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
start() { |
|
|
|
|
|
|
|
|
start_service() { |
|
|
config_load 'autossh' |
|
|
config_load 'autossh' |
|
|
config_foreach start_instance 'autossh' |
|
|
config_foreach start_instance 'autossh' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
stop() { |
|
|
|
|
|
service_stop /usr/sbin/autossh |
|
|
|
|
|
} |
|
|
|