ssh_to: start a tmux session if none is found

This commit is contained in:
Corrado Primier 2018-12-30 15:01:39 +00:00
parent 9661c41214
commit aceb214659

View File

@ -20,8 +20,8 @@ MOSH=`command -v mosh`
HOST=${0##/*/}
if [[ ! -z $TMUX ]] ; then
echo "Error: tmux session detected, aborting to avoid tmux nesting"
echo "Error: local tmux session detected, aborting to avoid nesting"
exit 1
fi
"${MOSH}" -- "${HOST}" tmux a
"${MOSH}" "${HOST}" -- sh -c "tmux a || tmux"