Created
September 24, 2013 05:47
-
-
Save orangejulius/6680817 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
createTunnel() { | |
/usr/bin/ssh -f -N -R 10022:localhost:22 -L19922:juliansimioni.com:27823 juliansimioni.com | |
if [[ $? -eq 0 ]]; then | |
echo Tunnel to hostb created successfully | |
else | |
echo An error occurred creating a tunnel to hostb RC was $? | |
fi | |
} | |
/usr/bin/ssh -p 19922 localhost ls | |
if [[ $? -ne 0 ]]; then | |
echo Creating new tunnel connection | |
createTunnel | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment