faca1c349f44812624b97cc911276c02d261de25
[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 monitorport "$section" monitorport
9 config_get poll "$section" poll
10
11 AUTOSSH_POLL=${poll:-"600"} autossh -M ${monitorport:-"20000"} -f ${ssh}
12 }
13
14 start() {
15 config_load "autossh"
16 config_foreach start_service autossh
17 }
18
19 stop() {
20 killall autossh
21 }
22
23 restart() {
24 stop
25 start
26 }