Updated some of the output messages on the iperf3 script

This commit is contained in:
Phil
2023-07-22 19:41:32 +01:00
parent d52af1436e
commit e84643e096
2 changed files with 10 additions and 10 deletions
+7 -7
View File
@@ -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