Created
February 24, 2015 23:45
-
-
Save mzeier/ba0bdae180206f4408d8 to your computer and use it in GitHub Desktop.
getscreen
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
mrz@mail [~/] 42> cat bin/getscreen | |
#!/bin/sh | |
SESSION=$1 | |
env | grep SSH | sed -e 's/=/ "/' | sed -e 's/$/"/'| awk '{print "setenv " $0}' > ~/.screen-ssh.$SESSION | |
echo -ne "\033]0;$SESSION\007" | |
/usr/bin/screen -rx -d $SESSION | |
if [ $? -gt 0 ]; then | |
/usr/bin/screen -xr $SESSION | |
if [ $? -gt 0 ]; then | |
if [ $SESSION = "test" ]; then | |
/usr/bin/screen -S $SESSION | |
else | |
/usr/bin/screen -S $SESSION | |
fi | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment