-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·40 lines (36 loc) · 934 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
SESSION='cloudlab'
MACHINES=(
'pc272.emulab.net' # node 0
'pc340.emulab.net'
'pc330.emulab.net'
'pc356.emulab.net'
'pc326.emulab.net'
'pc339.emulab.net'
'pc354.emulab.net'
)
tmux has-session -t $SESSION &> /dev/null
if [ $? != 0 ]
then
count=0
for m in "${MACHINES[@]}";
do
if [ $((count++)) == 0 ]
then
tmux new-session -s $SESSION -n "seed" -d
else
if [ $((count % 2)) == 0 ] # FIXME may out of space
then
tmux split-window -t $SESSION:0 -v
else
tmux split-window -t $SESSION:0 -h
fi
fi
tmux send-keys -t $SESSION:0 "ssh -p 22 gongqi@$m" C-m
done
fi
tmux select-layout tiled # re-arrange panes
tmux setw synchronize-panes on
# tmux send-keys -t $SESSION:0 "echo SEND TO ALL!!!!" C-m
tmux select-window -t $SESSION:0
tmux attach -t $SESSION