Feats: Add Custom Iperf3 Server Option #113
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new command-line argument,
-p
, to theyabs.sh
script. This argument allows users to specify custom Iperf3 servers to use for network speed tests, overriding the default server list. This provides greater flexibility for users who may want to test against servers closer to their location, or servers with specific configurations.You can test this PR using public servers, for example on the page: https://iperf.fr/iperf-servers.php
Changes:
-p
argument parsing ingetopts
: Thegetopts 'bfdignhr4596jw:s:p:' flag
line now includesp
to recognize the new argument.IPERF_SERVERS
variable: A new variableIPERF_SERVERS
stores the value passed to the-p
argument.-h
flag output has been updated to explain the usage of the-p
argument, including the expected format for server definitions.launch_iperf
function now checks for the existence ofIPERF_SERVERS
. If defined, it replaces the defaultIPERF_LOCS
array with the custom servers parsed from the user's input.Usage:
The
-p
argument accepts a comma-separated list of Iperf3 server definitions. Each server definition must conform to the following format:host:port_range:name:location:network_modes
Where:
host
: The hostname or IP address of the Iperf3 server.port_range
: The range of ports the Iperf3 server is listening on (e.g.,5201-5210
).name
: A friendly name for the Iperf3 server (e.g.,MyServer
).location
: The location of the Iperf3 server (e.g.,New York, NY
).network_modes
: Network modes supported by the iperf server (IPv4, IPv6, or IPv4|IPv6).Example:
./yabs.sh -gd -p "ping.online.net:5200-5209:Scaleway:DC3 France (Paris):IPv4,paris.bbr.iperf.bytel.fr:9200-9240:Bouygues:France (Paris):IPv4|IPv6"
Output:
Update -h help message: