Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo apt-get install yad -y
- Iperf3Test()
- {
- iperf3 $1 $2 $3 $4| yad \
- --text-info \
- --title="KPN Speedtest" \
- --width=1000 --height=900 --center \
- --skipp-taskbar \
- --fixed \
- --button="Sluiten":1 \
- --buttons-layout=center \
- --tail
- }
- SpeedTest()
- {
- var=""
- speedtest $1 $2 $3 $4 -p yes --progress-update-interval=1000| tee tmp | yad \
- --text-info \
- --selectable-labels \
- --title="KPN Speedtest" \
- --width=1000 --height=900 --center \
- --skipp-taskbar \
- --fixed \
- --button="Sluiten":1 \
- --buttons-layout=center \
- --tail
- RF=$(cat tmp)
- echo $RF |grep -o 'http[s]\?://[^ ]\+' | tee tmp
- RF=$(cat tmp)
- yad --question \
- --title="KPN Speedtest" \
- --text "Wilt u de resultaten pagina openen\n\n$RF" \
- --button="Ja":1 --button="Nee":0 --buttons-layout=spread \
- --center
- ret=$?
- [[ $ret -eq 1 ]] && xdg-open $RF
- }
- options=( #3 Columns
- "1" "Ookla" "KPN Amstelveen"
- "2" "Ookla" "KPN Barendrecht"
- "3" "Ookla" "Jonaz Amersfoort"
- "4" "Ookla" "Automatisch"
- "5" "Iperf3" "AMS1"
- "6" "Iperf3" "AMS2"
- )
- while item=$(zenity \
- --title="KPN Speedtest" \
- --text="Kies een van de onderstaande Speedtest opties \nof tik het cijfer bij ID en druk Enter"\
- --list \
- --column="ID" --column="Type" --column="Server"\
- "${options[@]}" \
- --width=800 --height=500 \
- --ok-label="Test" --cancel-label="Exit"
- )
- do
- case "$item" in
- #option 1
- 1)SpeedTest -s 61186;;
- #option 2
- 2)SpeedTest -s 53438;;
- #option 3
- 3)SpeedTest -s 10644;;
- #option 4
- 4)SpeedTest;;
- #option 5
- 5)Iperf3Test -c speedtest.ams1.nl.leaseweb.net -p 5201-5210;;
- #option 6
- 6)Iperf3Test -c speedtest.ams2.nl.leaseweb.net -p 5201-5210;;
- *) echo "Ooops! Invalid $item,option.";;
- esac
- done
Add Comment
Please, Sign In to add comment