Last active
December 2, 2020 20:49
-
-
Save apie/bd51d876bf5e5354f8cefc0d0c8a2d8e to your computer and use it in GitHub Desktop.
Asks to attach screen, only if we are not already in a screen session.
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
#!/bin/bash | |
screen -list | |
if [ $? -eq 0 ] && [ -z "$STY" ] | |
then | |
echo -n "Attach screen session? (Y/n)" | |
read answer | |
if [ "$answer" == "" ] || [ "$answer" != "${answer#[Yy]}" ] ;then | |
screen -UraAd | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment