Created
September 15, 2021 16:16
-
-
Save denibertovic/08d90cd72a3ae1c65d4433337512c4a4 to your computer and use it in GitHub Desktop.
Automatically start screen from .bashrc
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
# Auto-screen invocation. see: http://taint.org/wk/RemoteLoginAutoScreen | |
# if we're coming from a remote SSH connection, in an interactive session | |
# then automatically put us into a screen(1) session. Only try once | |
# -- if $STARTED_SCREEN is set, don't try it again, to avoid looping | |
# if screen fails for some reason. | |
if [ "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" != x ] | |
then | |
STARTED_SCREEN=1 ; export STARTED_SCREEN | |
screen -RR -S main || echo "Screen failed! continuing with normal bash startup" | |
fi | |
# [end of auto-screen snippet] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment