home/Bin/attachTmux.sh
2020-07-05 10:29:44 +02:00

15 lines
239 B
Bash
Executable file

#! /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