source: trunk/puppet/modules/puppet-autossh/templates/tunnel-autossh.erb @ 499

Last change on this file since 499 was 499, checked in by sebas, 14 years ago

nuevo modulo para hacer tuneles ssh

File size: 884 bytes
Line 
1#!/bin/sh
2# port forwarding with ssh
3# installed with: update-rc.d tunnel-autossh start 18 2 3 4 5 . stop 81 0 1 6 .
4
5PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
6
7if ! [ -x /usr/bin/autossh ]; then
8    echo "Where is autossh?"
9    exit 0
10fi
11
12case "$1" in
13    start)
14       # same as above for the collector
15       # here we are binding to a host with an common internal interface (127.0.0.1)
16       /bin/su <%= autossh_tunneluser %> -c '/usr/bin/autossh -f -N -L <%= autossh_localport %>:<%= autossh_localip %>:<%= autossh_localportservice %> <%= autossh_remotehost %> -M <%= autossh_moniport %>'
17       echo "adding tunnel for ldap replication"
18       ;;
19    stop)
20       echo -n "destroying tunnel ..."
21       killall autossh
22       echo "destroyed!"
23       ;;
24
25    *)
26       echo "Usage: /etc/init.d/tunnel-autossh {start|stop}"
27       exit 1
28       ;;
29esac
30
Note: See TracBrowser for help on using the repository browser.