Skip to content

Instantly share code, notes, and snippets.

@corneliuskopp
corneliuskopp / screen.bashrc.sh
Created April 17, 2013 19:54
auto-start screen sessions if not exists, attach otherwise
if [ $SSH_TTY ] && [ ! $WINDOW ]; then
SCREENLIST=`screen -ls | grep 'Attached'`
if [ $? -eq "0" ]; then
echo -e "Screen is already running and attached:\n ${SCREENLIST}"
else
screen -U -R
fi
fi