25 lines
544 B
Bash
Executable file
25 lines
544 B
Bash
Executable file
#!/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 hv
|
|
|
|
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
|
|
counter=$(( counter + 1 ))
|
|
done
|
|
|
|
tmux select-window -t "$session":0
|
|
tmux attach-session -t "$session"
|