diff --git a/Linux/README.md b/Linux/README.md index 672bc69..b535d61 100644 --- a/Linux/README.md +++ b/Linux/README.md @@ -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 diff --git a/Linux/speedtest.sh b/Linux/speedtest.sh index 875fec4..27d7130 100755 --- a/Linux/speedtest.sh +++ b/Linux/speedtest.sh @@ -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')