Added script attach/create tmux session
This commit is contained in:
parent
4e158b14ab
commit
b890907204
1 changed files with 15 additions and 0 deletions
15
Bin/attachTmux.sh
Executable file
15
Bin/attachTmux.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#! /bin/bash
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Missing session name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TMUXSESSION=$1
|
||||
EXISTS=`tmux ls|grep "${TMUXSESSION}:"`
|
||||
|
||||
if [ -z "${EXISTS}" ]; then
|
||||
tmux new -s ${TMUXSESSION}
|
||||
else
|
||||
tmux attach-session -t ${TMUXSESSION}
|
||||
fi
|
Loading…
Reference in a new issue