Created
March 21, 2014 03:32
-
-
Save prelongs/9678995 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
while [ " == " ] | |
do | |
ssh_d_process_num=`ps aux |grep -E 'ssh ' |grep localhost |grep -v grep | wc -l` | |
if [ "$ssh_d_process_num" == "0" ]; then | |
echo "Trying to reconnect..." | |
ssh -gNfR *:10000:localhost:22 [email protected] -p2222 & | |
fi | |
sleep 60 | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment