Brenden Blanco | a1b882d | 2015-06-24 18:31:14 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | cmd="ip netns exec host0" |
| 4 | if [[ "$(id -u)" != "0" ]]; then |
| 5 | cmd="sudo $cmd" |
| 6 | fi |
| 7 | |
| 8 | B=/usr/bin/byobu |
| 9 | S=tunnel1 |
| 10 | |
| 11 | tmux has-session -t $S &> /dev/null |
| 12 | |
| 13 | if [[ $? != 0 ]]; then |
| 14 | $B new-session -s $S -n "c1" -d |
| 15 | tmux send -t $S "$cmd ping 192.168.0.1 -s512" C-m |
| 16 | tmux new-window -t $S -n "c2" |
| 17 | tmux send -t $S "$cmd ping 192.168.0.2 -s128" C-m |
| 18 | tmux new-window -t $S -n "c3" |
| 19 | tmux send -t $S "$cmd ping 192.168.0.3 -s1024" C-m |
| 20 | tmux new-window -t $S -n "c3" |
| 21 | tmux send -t $S "$cmd ping 192.168.0.4 -s128" C-m |
| 22 | tmux new-window -t $S -n "c3" |
| 23 | tmux send -t $S "$cmd ping 192.168.0.5 -s128" C-m |
| 24 | tmux new-window -t $S -n "c3" |
| 25 | tmux send -t $S "$cmd ping 192.168.0.6 -s128" C-m |
| 26 | tmux new-window -t $S -n "c4" |
| 27 | tmux send -t $S "$cmd ping 192.168.1.2 -s128" C-m |
| 28 | tmux new-window -t $S -n "c5" |
| 29 | tmux send -t $S "$cmd ping 192.168.1.4 -s768" C-m |
| 30 | tmux new-window -t $S -n "c2" |
| 31 | tmux send -t $S "$cmd ping 192.168.2.2 -s128" C-m |
| 32 | tmux new-window -t $S -n "c3" |
| 33 | tmux send -t $S "$cmd ping 192.168.2.7 -s1024" C-m |
| 34 | tmux new-window -t $S -n "c4" |
| 35 | tmux send -t $S "$cmd ping 192.168.2.2 -s128" C-m |
| 36 | tmux new-window -t $S -n "c5" |
| 37 | tmux send -t $S "$cmd ping 192.168.3.8 -s768" C-m |
| 38 | tmux new-window -t $S -n "c5" |
| 39 | tmux send -t $S "$cmd ping 192.168.3.9 -s768" C-m |
| 40 | fi |
| 41 | |
| 42 | exec tmux attach -t $S |
| 43 | |