Created
November 23, 2009 18:48
-
-
Save jhsu/241271 to your computer and use it in GitHub Desktop.
auto reattach screen
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
| function _resumescreen() | |
| { | |
| test ${TERM/\.*/} = "screen" && return 1 #do nothing if inside screen. | |
| test ${TERM/\.*/} = "dumb" && return 1 #do nothing if inside screen. | |
| test ${TERM/\.*/} = "su" && return 1 #do nothing if inside screen. | |
| screen -q -ls #check if we have any screen sessions running | |
| test $? -ge 10 && screen -xR #and auto login if we do. | |
| } | |
| _resumescreen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment