Created
December 15, 2014 23:08
-
-
Save kwmiebach/6308990797501a655345 to your computer and use it in GitHub Desktop.
start a named byobu session for a user
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
$ 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