From c9695a02688db4f0d69c6294afa987e395030956 Mon Sep 17 00:00:00 2001 From: Przemyslaw Grondek Date: Mon, 15 Jul 2019 11:19:55 +0200 Subject: [PATCH] [bash] Start server sesssions in screen if possible --- bash/bashrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bash/bashrc b/bash/bashrc index ff0fcfa..3a05097 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -146,3 +146,16 @@ fi export VISUAL=vim export EDITOR="$VISUAL" + +# Start all sessions in screen when running on server +if [ "$computer_type" == "server" ]; then + if [ -d /usr/bin/screen ]; then + echo Server + if [ -z "$STY" ]; then + screen -R; + exit + fi + else + echo "Warning, no screen binary found" + fi +fi