Last active
August 29, 2015 14:27
-
-
Save tamsky/1353addfc67c9266ed87 to your computer and use it in GitHub Desktop.
Close all open ControlMaster sockets. Assumes ssh config has "ControlPath ~/.ssh/connections/%r_%h_%p"
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
( | |
cd ~/.ssh/connections/ | |
for i in * ; do | |
PORT=${i##*_} | |
USER=${i%%_*} | |
UR=${i%%_$PORT} | |
REMOTE=${UR##$USER$'_'} | |
host: ${REMOTE} | |
ssh ${USER}@${REMOTE} -p ${PORT} -O exit | |
done | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment