custom-iperf: init of script

This commit is contained in:
2025-07-14 11:53:19 +02:00
parent 155696c12f
commit b470f1cf43

22
.local/bin/custom-iperf Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
SERVER="$1"
if [ -z "$SERVER" ]; then
echo "Usage: $0 <server_ip>"
exit 1
fi
echo "Starting..."
echo
# Upload test (client sends data to server)
UPLOAD=$(iperf3 -c "$SERVER" -P5 -t 30 --json | jq '.end.sum_sent.bits_per_second / 1000000')
# Download test (client receives data from server)
DOWNLOAD=$(iperf3 -c "$SERVER" -P5 -t 30 -R --json | jq '.end.sum_received.bits_per_second / 1000000')
# Print summary
echo "SERVER: $SERVER"
echo "UPLOAD: $(printf "%.2f" "$UPLOAD") Mbps"
echo "DOWNLOAD: $(printf "%.2f" "$DOWNLOAD") Mbps"