Skip to content

Instantly share code, notes, and snippets.

@arooni
Created May 19, 2016 20:29
Show Gist options
  • Save arooni/c7ba3556d3a7e123fd65d310a0041094 to your computer and use it in GitHub Desktop.
Save arooni/c7ba3556d3a7e123fd65d310a0041094 to your computer and use it in GitHub Desktop.
#! /bin/sh
case "${1}" in
suspend|hibernate)
;;
resume|thaw)
lsof -t -i:24800
# Is synergy already running? Then kill existing ssh and synergy clients before reconnecting
if [ $? -eq 0 ]
then
kill $(lsof -t -i:24800)
fi
# Now we know it's not running; so it's safe to restart it.
ssh -N -f -L 24800:localhost:24800 david@192.168.1.100
synergyc localhost &
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment