Created
January 28, 2015 10:44
-
-
Save huksley/9c4495632f42fdacd3d2 to your computer and use it in GitHub Desktop.
Sample script for autossh based tunnel (autorestart, keeping connection alive) https://www.async.fi/2013/07/autossh-with-ubuntu-upstart/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "AutoSSH tunnel 1" | |
author "Huksley" | |
start on (local-filesystems and net-device-up IFACE!=lo) | |
stop on runlevel [!2345] | |
expect fork | |
respawn | |
respawn limit 5 60 | |
exec autossh -f -M 0 -N -L 8111:192.168.1.1:111 -i private.key -l username hostname -o "ServerAliveInterval=10" -o "ServerAliveCountMax=3" -o "StrictHostKeyChecking=no" -o "BatchMode=yes" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment