scripts/supertmux

29 lines
669 B
Text
Raw Normal View History

#!/bin/sh
# supertmux: open a tmux session with ssh connections to some servers
session=`hostname -s`
servers="db dns ftp mail web"
tmux kill-server
tmux start-server
tmux new-session -d -s $session;
tmux rename-window $session
tmux set-option status-style fg=white,bg=black
tmux set-option -g status-right "[%D %H:%M]"
tmux set-option -g status-justify centre
counter=1
for server in $servers
do
tmux new-window -t $session:$counter
tmux select-window -t $session:$counter
tmux rename-window $server
tmux send -t $session:$counter "ssh $server" ENTER
let counter=$counter+1 >/dev/null
done
tmux select-window -t $session:0
tmux attach-session -t $session