User Tools

Site Tools


public:doku:autoscreen

Autoscreen

Wenn man sich einloggt startet einen neue Screen-Sitzung, falls noch keine existiert. Wenn eine Sitzung existiert wird sich dieser verbunden.

das kommt direkt an den Anfang der ~/.bashrc

~/.bashrc

# 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
    [ -d $HOME/lib/screen-logs ] || mkdir -p $HOME/lib/screen-logs
    sleep 1
    screen -RR && exit 0
    # normally, execution of this rc script ends here...
    echo "Screen failed! continuing with normal bash startup"
fi
# [end of auto-screen snippet]

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

public/doku/autoscreen.txt · Last modified: 2014/10/25 18:12 (external edit)