function plug-in-tmux() { if `tmux ls -F '#{session_name}' | grep $LC_SSH_USER >/dev/null` ; then tmux attach -t $LC_SSH_USER else tmux new -s $LC_SSH_USER -t SDDEV fi } if [ -z "$TMUX" ]; then if [[ `hostname` == "dockerservice" ]]; then plug-in-tmux || tmuxinator start ssh_tmux || tmux new -s ssh_tmux else tmux attach || tmuxinator start ssh_tmux || tmux new -s ssh_tmux fi fi