Created
May 7, 2014 19:32
-
-
Save paulgb/81877713c6512ffae5f3 to your computer and use it in GitHub Desktop.
Bash function for managing remote screen sessions
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
# replace all instances of "servername" with the remote host name | |
# `servername` lists available screen sessions | |
# `servername <session>` connects to a given session | |
function servername { | |
if [ -n "$1" ]; then | |
ssh -t servername "screen -DR $1"; | |
else | |
echo "Usage: servername [environment]"; | |
echo "Open sessions:" | |
ssh -t servername "screen -ls"; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment