Updated speedtest-cli command to parse the org and IP with jq instead of python. Updated README.md
This commit is contained in:
parent
90d6f0b51d
commit
5154d89f77
@ -9,6 +9,7 @@ A basic script that uses Speedtest-cli and/or iperf3 and logs the result to a cs
|
||||
If you want to use speedtest-cli to test, the following dependencies will be required.
|
||||
|
||||
1) Speedtest CLI: https://www.speedtest.net/apps/cli
|
||||
2) jq (lightweight and flexible command-line JSON processor): https://github.com/jqlang/jq
|
||||
|
||||
|
||||
### iperf3
|
||||
|
||||
@ -28,7 +28,7 @@ SPEEDTESTCLI="SET TO 0 or 1"
|
||||
# If you set 0 for no, you dont have to fill in the IPERF3_SERVER_IP setting
|
||||
IPERF3="SET TO 0 or 1"
|
||||
# Set the iPerf3 server IP or Hostname that you want to use
|
||||
IPERF3_SERVER_IP="IPERF3.SERVER.IPor.HOSTNAME"
|
||||
IPERF3_SERVER_IP="IPERF3.SERVER.IP.or.HOSTNAME"
|
||||
|
||||
|
||||
|
||||
@ -56,11 +56,11 @@ WEBHOOK_URL="DISCORD_WEBHOOK_URL"
|
||||
|
||||
# # --------------Get Current IP Info--------------
|
||||
# Get IP info
|
||||
INFO=$(curl -s https://ipv4.am.i.mullvad.net/json | python -m json.tool)
|
||||
INFO=$(curl -s https://ipv4.am.i.mullvad.net/json | jq)
|
||||
# Get Reported IP
|
||||
IP=$(echo "$INFO" | grep -oE '"ip":\s*"[^"]+"' | grep -oE '[0-9.]+')
|
||||
IP=$(echo "$INFO" | jq -r '.ip')
|
||||
# Get Reported ISP
|
||||
ORG=$(echo "$INFO" | grep -oP '(?<="organization":")[^"]+')
|
||||
ORG=$(echo "$INFO" | jq -r '.organization')
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user