You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
565 B

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