sshtunnel: move to github

Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
This commit is contained in:
Nuno Goncalves
2014-09-16 01:37:29 +01:00
parent 8f52a803a4
commit 73392f3ff3
4 changed files with 335 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
PIDFILE="/tmp/run/sshtunnel"
args="$1"
retrydelay="$2"
server="$3"
while true
do
logger -p daemon.info -t "sshtunnel[$$][$server]" "connection started"
start-stop-daemon -S -p "${PIDFILE}_${$}.pid" -mx ssh -- $args &>/tmp/log/sshtunnel_$$
logger -p daemon.err -t "sshtunnel[$$][$server]" < /tmp/log/sshtunnel_$$
rm /tmp/log/sshtunnel_$$
logger -p daemon.info -t "sshtunnel[$$][$server]" "ssh exited with code $?, retrying in $retrydelay seconds"
rm "${PIDFILE}_${$}.pid"
sleep "$retrydelay" & wait
done