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.

33 lines
646 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. config_get_bool enabled "$section" 'enabled' '1'
  11. [ "$enabled" = 1 ] || exit 0
  12. export AUTOSSH_GATETIME="${gatetime:-30}"
  13. export AUTOSSH_POLL="${poll:-600}"
  14. service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh}
  15. }
  16. boot() {
  17. return
  18. }
  19. start() {
  20. config_load 'autossh'
  21. config_foreach start_instance 'autossh'
  22. }
  23. stop() {
  24. service_stop /usr/sbin/autossh
  25. }