Created
November 30, 2010 09:33
-
-
Save Ruxton/721407 to your computer and use it in GitHub Desktop.
bananjour to screen and back again
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
bananajourd() { | |
local check=`screen -list|grep bananajour|awk '{print $1}'` | |
if [[ "$1" = "" ]]; then | |
if [[ "${check}" = "" ]]; then | |
screen -dmS bananajour bananajour | |
echo "Started bananajour in background" | |
else | |
echo "Bananajour is running in background..." | |
read -p "re-attach? (y/n)" choice | |
if [[ $choice = [yY] ]]; then | |
echo "Attaching bananajour session..." | |
screen -r $check | |
else | |
echo "Bananajour currently running at ${check}" | |
fi | |
fi | |
else | |
if [[ $1 -eq "load" ]]; then | |
screen -r bananajour | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment