Created
May 19, 2016 20:29
-
-
Save arooni/c7ba3556d3a7e123fd65d310a0041094 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/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