Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavid committed Nov 12, 2023
1 parent 7fa7e23 commit b282a2b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/speed
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,21 @@ test_speed() {
loge Check internet connection.
return 0
}
local out
local down host out up
out="$(speedtest-cli 2>&1)" || {
loge "$(printf %s "$out" | xargs)"
loge "$out"
return 0
}
local down
down="$(printf %s "$out" | grep -E '^Download: ' | gawk '{print $2}')" || {
loge "$out: $down"
loge "$out: $down: down."
return 0
}
local up
up="$(printf %s "$out" | grep -E '^Upload: ' | gawk '{print $2}' )" || {
loge "$out: $up"
loge "$out: $up: up."
return 0
}
local host
host="$(printf %s "$out" | grep -E '^Hosted by ' | cut -c11- )" || {
loge "$out: $host"
loge "$out: $host: host."
return 0
}
tsout "| $(printf %6s "$down") | $(printf %6s "$up") | $host"
Expand Down

0 comments on commit b282a2b

Please sign in to comment.