autossh.init (565B)
1 #!/bin/sh /etc/rc.common 2 # Copyright (C) 2007-2011 OpenWrt.org 3 4 START=80 5 6 start_instance() { 7 local section="$1" 8 9 config_get ssh "$section" 'ssh' 10 config_get gatetime "$section" 'gatetime' 11 config_get monitorport "$section" 'monitorport' 12 config_get poll "$section" 'poll' 13 14 export AUTOSSH_GATETIME="${gatetime:-30}" 15 export AUTOSSH_POLL="${poll:-600}" 16 service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh} 17 } 18 19 boot() { 20 return 21 } 22 23 start() { 24 config_load 'autossh' 25 config_foreach start_instance 'autossh' 26 } 27 28 stop() { 29 service_stop /usr/sbin/autossh 30 }