ping_template: attach if session exists
This commit is contained in:
parent
78fae44ff7
commit
0ad561ec0b
1 changed files with 25 additions and 20 deletions
|
@ -2,30 +2,35 @@
|
|||
|
||||
conn=$1; shift
|
||||
|
||||
if tmux ls | grep ^${conn}:; then
|
||||
tmux attach -t ${conn}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$conn" in
|
||||
rm)
|
||||
tmux new-session -s ping_rm -d ping 2a0f:98c0:1::2
|
||||
tmux split-window -t ping_rm -h ping 2a0f:98c0:2::2
|
||||
tmux split-window -t ping_rm -h ping 2a0f:98c0:9::2
|
||||
tmux select-layout -t ping_rm even-horizontal
|
||||
tmux split-window -t ping_rm -v ping 2a0f:98c0:9::3
|
||||
tmux select-pane -t ping_rm -L
|
||||
tmux split-window -t ping_rm -v ping 2a0f:98c0:2::3
|
||||
tmux select-pane -t ping_rm -L
|
||||
tmux split-window -t ping_rm -v ping 2a0f:98c0:1::3
|
||||
tmux attach -t ping_rm
|
||||
tmux new-session -s ${conn} -d ping 2a0f:98c0:1::2
|
||||
tmux split-window -t ${conn} -h ping 2a0f:98c0:2::2
|
||||
tmux split-window -t ${conn} -h ping 2a0f:98c0:9::2
|
||||
tmux select-layout -t ${conn} even-horizontal
|
||||
tmux split-window -t ${conn} -v ping 2a0f:98c0:9::3
|
||||
tmux select-pane -t ${conn} -L
|
||||
tmux split-window -t ${conn} -v ping 2a0f:98c0:2::3
|
||||
tmux select-pane -t ${conn} -L
|
||||
tmux split-window -t ${conn} -v ping 2a0f:98c0:1::3
|
||||
tmux attach -t ${conn}
|
||||
;;
|
||||
rmapu)
|
||||
tmux new-session -s ping_rm -d ping 2a0f:98c0:1::15
|
||||
tmux split-window -t ping_rm -h ping 2a0f:98c0:2::15
|
||||
tmux split-window -t ping_rm -h ping 2a0f:98c0:9::15
|
||||
tmux select-layout -t ping_rm even-horizontal
|
||||
tmux split-window -t ping_rm -v ping 2a0f:98c0:9::16
|
||||
tmux select-pane -t ping_rm -L
|
||||
tmux split-window -t ping_rm -v ping 2a0f:98c0:2::16
|
||||
tmux select-pane -t ping_rm -L
|
||||
tmux split-window -t ping_rm -v ping 2a0f:98c0:1::16
|
||||
tmux attach -t ping_rm
|
||||
tmux new-session -s ${conn} -d ping 2a0f:98c0:1::15
|
||||
tmux split-window -t ${conn} -h ping 2a0f:98c0:2::15
|
||||
tmux split-window -t ${conn} -h ping 2a0f:98c0:9::15
|
||||
tmux select-layout -t ${conn} even-horizontal
|
||||
tmux split-window -t ${conn} -v ping 2a0f:98c0:9::16
|
||||
tmux select-pane -t ${conn} -L
|
||||
tmux split-window -t ${conn} -v ping 2a0f:98c0:2::16
|
||||
tmux select-pane -t ${conn} -L
|
||||
tmux split-window -t ${conn} -v ping 2a0f:98c0:1::16
|
||||
tmux attach -t ${conn}
|
||||
;;
|
||||
rmv6)
|
||||
tmux new-session -s rmv6 -d ping 2a0f:98c0:7::1
|
||||
|
|
Loading…
Reference in a new issue