dotfiles/bin/.bin/sshtmux
Anthony Debucquoy 4c27a8e3f1
Adding bin files
tmuxssh allow to connect and attach or create a tmux session.
2023-11-29 13:12:15 +01:00

12 lines
237 B
Bash
Executable File

#!/bin/sh
# A name for the session
session_name="$(whoami)_sess"
if [ ! -z $1 ]; then
ssh -t "$1" "tmux attach -t $session_name || tmux new -s $session_name"
else
echo "Usage: sshtmux HOSTNAME"
echo "You must specify a hostname"
fi