Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- var=$(hostname);
- av="Average";
- cv="0% packet loss";
- htszt="Igen";
- str="Nem";
- function pingAfromB () {
- ssh $1 sudo route add -n 10.0.0.0 netmask 255.255.255.0 dev $2
- ssh $1 sudo ifconfig $2 $3 netmask 255.255.255.255 up
- ssh $4 sudo ifconfig $2 $5 netmask 255.255.255.255 up
- myv=$(ssh $1 ping $5 -c1 | grep -B 0 "packet loss"|sed "s/\(.*\)*\(0% packet loss\)\(.*\)/\2/");
- if [ "$myv" != "$cv" ]; then
- zenity --info --text "Incorrect Link Between C11 - C12";
- fi
- ssh $1 sudo ifconfig $2 down
- ssh $4 sudo ifconfig $2 down
- }
- halot=$(zenity --list --text "Milyen rész induljon?" --radiolist --column "Pick" --column "Opinion" TRUE Halozati_teszt FALSE Network_coding FALSE Average);
- if [ -n "$halot" ]; then
- if [ "$halot" == "Halozati_teszt" ]; then
- if [ "$var" == "lab29" ]; then
- pingAfromB lab29 eht0 10.0.0.33 lab30 10.0.0.1
- pingAfromB lab29 eht1 10.0.0.22 lab27 10.0.0.29
- pingAfromB lab29 eht2 10.0.0.11 lab26 10.0.0.18
- pingAfromB lab28 eht0 10.0.0.30 lab23 10.0.0.2
- pingAfromB lab29 eht1 10.0.0.20 lab25 10.0.0.17
- pingAfromB lab29 eht2 10.0.0.10 lab27 10.0.0.19
- pingAfromB lab27 eht0 10.0.0.39 lab24 10.0.0.16
- pingAfromB lab24 eht1 10.0.0.36 lab26 10.0.0.28
- pingAfromB lab29 eht2 10.0.0.26 lab25 10.0.0.27
- pingAfromB lab26 eht0 10.0.0.38 lab19 10.0.0.3
- pingAfromB lab29 eht0 10.0.0.37 lab21 10.0.0.5
- ssh lab19 sudo ifconfig eth0 10.0.0.3 netmask 255.255.255.255 up
- ssh lab21 sudo ifconfig eth0 10.0.0.5 netmask 255.255.255.255 up
- ssh lab23 sudo ifconfig eth0 10.0.0.2 netmask 255.255.255.255 up
- ssh lab30 sudo ifconfig eth0 10.0.0.1 netmask 255.255.255.255 up
- fi
- fi
- fi
Add Comment
Please, Sign In to add comment