Created
May 25, 2013 20:01
-
-
Save maus-/5650573 to your computer and use it in GitHub Desktop.
synergyconnect.sh
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 | |
# 2012 Maus Stearns, | |
# Quick ssh tunneling / reconnect tool | |
# Used primarily for quick synergy tunnels. | |
RHOST=192.168.1.1 | |
RPORT=24800 | |
PID=$(ps -ef |grep ssh |grep $RPORT | awk '{print $2}') | |
if [ -n "$PID" ]; then | |
echo "Existing Connection Exists. $PID" | |
kill -9 $PID | |
fi | |
ssh -f -N -L $RPORT:$RHOST:$RPORT $RHOST | |
# # When using a OSX / Synergy Use | |
# open /Applications/Synergy.app | |
# # if on nix* | |
# synergyc localhost:24800 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment