Skip to content

Instantly share code, notes, and snippets.

@kwmiebach
Created December 15, 2014 23:08
Show Gist options
  • Save kwmiebach/6308990797501a655345 to your computer and use it in GitHub Desktop.
Save kwmiebach/6308990797501a655345 to your computer and use it in GitHub Desktop.
start a named byobu session for a user
$ which wbio
/usr/bin/wbio
$ cat `which wbio`
#/bin/bash
# start byobu as user:
USER=webroot
# without parameters: list existing sessions
if [ -z "$1" ] ; then
ps aux|grep byobu|grep "\-S"
exit
fi
# first parameter: name for connecting to existing or creating new byobu session.
# second parameter (optional): starting directory (defaults to USER's home dir).
# start a named byobu session:
sudo su - -c "cd $2 && byobu -S $1" $USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment