[package] add autossh hotplug script, remove duplicate restart init script function...
[packages.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 boot() {
15         return
16 }
17
18 start() {
19         config_load "autossh"
20         config_foreach start_service autossh
21 }
22
23 stop() {
24         killall autossh
25 }