Updated some of the output messages on the iperf3 script
This commit is contained in:
parent
d52af1436e
commit
e84643e096
@ -8,11 +8,11 @@ Within this folder there is 2 different versions of the speedtest script.
|
||||
## speedtest-cli
|
||||
This script uses the speedtest-cli test and requires the following dependencies.
|
||||
#### Dependencies
|
||||
Speedtest CLI: https://www.speedtest.net/apps/cli
|
||||
1) Speedtest CLI: https://www.speedtest.net/apps/cli
|
||||
|
||||
|
||||
## iperf3
|
||||
This script uses the iperf3 software and required a iperf3 server ip to be used to test. This version requires the following dependencies.
|
||||
#### Dependencies
|
||||
iperf3: https://iperf.fr/iperf-download.php
|
||||
jq (lightweight and flexible command-line JSON processor): https://github.com/jqlang/jq
|
||||
1) iperf3: https://iperf.fr/iperf-download.php
|
||||
2) jq (lightweight and flexible command-line JSON processor): https://github.com/jqlang/jq
|
||||
|
||||
@ -8,13 +8,13 @@ WAN=SET_NUMBER
|
||||
log=SET_NUMBER
|
||||
|
||||
# Set the path to the log file
|
||||
LOG_FILE="speedtest.csv file"
|
||||
LOG_FILE="./speedtest.csv"
|
||||
|
||||
# Do you want the script to output to a Discord webhook? Set discord variable to 1 for yes, 0 for no
|
||||
discord=SET_NUMBER
|
||||
|
||||
# Set your Discord webhook URL
|
||||
WEBHOOK_URL="DISCORD WEBHOOK URL"
|
||||
WEBHOOK_URL="https://DISCORD_WEBHOOK_URL"
|
||||
|
||||
# Set the iPerf3 server IP that you wantr to use
|
||||
IPERF3_SERVER_IP=SERVER.IP.ADDRESS.HERE
|
||||
@ -61,22 +61,22 @@ if [ -z "$DOWNLOAD_Mbps" ] || [ -z "$UPLOAD_Mbps" ]; then
|
||||
fi
|
||||
|
||||
if [ "$log" -eq 1 ]; then
|
||||
echo "Variable is set to 1. Running command A."
|
||||
echo "Log Variable is set to 1. Writing to log."
|
||||
|
||||
# Append the result to the log file
|
||||
echo "$(date +"%Y-%m-%d %H:%M:%S"),$ORG,$IP,$DOWNLOAD_Mbps Mbps,$UPLOAD_Mbps Mbps" >> "$LOG_FILE"
|
||||
|
||||
# Check if the variable is set to 0
|
||||
elif [ "$log" -eq 0 ]; then
|
||||
echo "Skipping log to file"
|
||||
echo "Log Variable is set to 0. Skipping log to file"
|
||||
|
||||
# Variable is not set to 1 or 0
|
||||
else
|
||||
echo "Variable is not set to a valid value."
|
||||
echo "Discord Variable is not set to a valid value."
|
||||
fi
|
||||
|
||||
if [ "$discord" -eq 1 ]; then
|
||||
echo "Variable is set to 1."
|
||||
echo "Discord Variable is set to 1. Sending to Discord"
|
||||
|
||||
# Prepare the payload for the Discord webhook
|
||||
curl -H "Content-Type: application/json" -X POST --data @- "$WEBHOOK_URL" <<EOF
|
||||
@ -116,7 +116,7 @@ EOF
|
||||
|
||||
# Check if the variable is set to 0
|
||||
elif [ "$discord" -eq 0 ]; then
|
||||
echo "Skipping send to Discord"
|
||||
echo "Discord Variable is set to 0. Skipping send to Discord"
|
||||
|
||||
# Variable is not set to 1 or 0
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user