Created
December 8, 2022 05:14
-
-
Save San3-Cod3/dfc039cb2bb2da0a3a6852a71be76027 to your computer and use it in GitHub Desktop.
speedtest-cli — results you care about, returned ~ all on a single line; w/o the faff.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# create/place in: /home/YOU/ or /usr/bin/ # ( sudo needed for latter ) # | |
# chmod +x speedtest-cli_jq_json.sh # | |
# sudo apt-get install -y jq speedtest-cli # | |
# ˇ jq explained simply @ link below ˇ # | |
# https://puu.sh/JslQO/c0d473928e.png # | |
# ˇ usage: ˇ # | |
# ./speedtest-cli_jq_json.sh # ( if in: /home/YOU/ ) # | |
# speedtest-cli_jq_json.sh # ( if placed in: /usr/bin/ ) # | |
# ˇ how snippet looks once executed ˇ # | |
# https://puu.sh/JslST/397941d6ca.png # | |
read p d u < <(\ | |
speedtest-cli --json \ | |
| jq -r '[.ping, .download/1000000, .upload/1000000] | join(" ")' | |
) | |
printf 'Ping: %.02f ms || Download: %.02f Mbit/s || Upload: %.02f Mbit/s\n' "$p" "$d" "$u" |
Author
San3-Cod3
commented
Oct 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment