source: packages/net/sshtunnel/files/usr/bin/sshtunnel.sh @ 21111

Last change on this file since 21111 was 21111, checked in by nunojpg, 7 years ago

[packages] add sshtunnel, Manages Local and Remote openssh ssh(1) tunnels

  • Property svn:executable set to *
File size: 463 bytes
Line 
1#!/bin/sh
2
3PIDFILE="/tmp/run/sshtunnel"
4
5args=$1
6retrydelay=$2
7
8while true
9do
10        logger -p daemon.info -t "sshtunnel[$$]" "connecting: ssh $args"
11       
12        start-stop-daemon -S -p "$PIDFILE"_"$$".pid -mx ssh -- $args &>/tmp/log/sshtunnel_$$ 
13        logger -p daemon.err -t "sshtunnel[$$]" < /tmp/log/sshtunnel_$$
14        rm /tmp/log/sshtunnel_$$
15       
16        logger -p daemon.info -t "sshtunnel[$$]" "ssh exited with code $?, retrying in $retrydelay seconds"
17       
18        sleep "$retrydelay" & wait
19done
Note: See TracBrowser for help on using the repository browser.