Skip to content

Instantly share code, notes, and snippets.

@maus-
Created May 25, 2013 20:01
Show Gist options
  • Save maus-/5650573 to your computer and use it in GitHub Desktop.
Save maus-/5650573 to your computer and use it in GitHub Desktop.
synergyconnect.sh
#!/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