[package] autossh: increase reliability of connection behavior
[openwrt/svn-archive/archive.git] / net / autossh / files / autossh.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2007 OpenWrt.org
3 START=80
4
5 start_service () {
6 local section="$1"
7 config_get ssh "$section" ssh
8 config_get gatetime "$section" gatetime
9 config_get monitorport "$section" monitorport
10 config_get poll "$section" poll
11
12 AUTOSSH_GATETIME=${gatetime:-"30"} AUTOSSH_POLL=${poll:-"600"} autossh -M ${monitorport:-"20000"} -f ${ssh}
13 }
14
15 boot() {
16 return
17 }
18
19 start() {
20 config_load "autossh"
21 config_foreach start_service autossh
22 }
23
24 stop() {
25 killall autossh
26 }