Skip to content

Instantly share code, notes, and snippets.

@Ruxton
Created November 30, 2010 09:33
Show Gist options
  • Save Ruxton/721407 to your computer and use it in GitHub Desktop.
Save Ruxton/721407 to your computer and use it in GitHub Desktop.
bananjour to screen and back again
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