diff --git a/README.md b/README.md index 21421e3..9061780 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,7 @@ These scripts work for [OpenWrt](https://openwrt.org) and include: that can be taped on the side of the router. * [betterspeedtest.sh](#betterspeedtestsh) & - [netperfrunner.sh](#netperfrunnersh) & - [networkhammer.sh](#networkhammersh) - scripts that measure the + [netperfrunner.sh](#netperfrunnersh) - scripts that measure the performance of your router or offer load to the network for testing. * [idlelatency.sh](#idlelatencysh) - a script to measure the latency of @@ -344,12 +343,6 @@ This is not a bug, nor is it a problem with your internet connection. That's because the acknowledge messages sent back to the sender consume a significant fraction of the link's capacity (as much as 25%). -## [networkhammer.sh](https://github.com/richb-hanover/OpenWrtScripts/blob/master/networkhammer.sh) - -The `networkhammer.sh` script continually invokes the netperfrunner script to -provide a heavy load. -It runs forever - Ctl-C will interrupt it. - ## [idlelatency.sh](https://github.com/richb-hanover/OpenWrtScripts/blob/master/idlelatency.sh) _This script is no longer maintained. diff --git a/betterspeedtest.sh b/betterspeedtest.sh index d045d31..9995a51 100755 --- a/betterspeedtest.sh +++ b/betterspeedtest.sh @@ -160,7 +160,7 @@ measure_direction() { ERRFILE=$(mktemp /tmp/netperfErr.XXXXXX) || exit 1 DIRECTION=$1 - # start off the ping process +# start off the ping process start_pings # Start netperf with the proper direction @@ -169,7 +169,7 @@ measure_direction() { else dir="TCP_STREAM" fi - + # Start $MAXSESSIONS datastreams between netperf client and the netperf server # netperf writes the sole output value (in Mbps) to stdout when completed for i in $( seq "$MAXSESSIONS" ) @@ -231,6 +231,13 @@ MAXSESSIONS="5" TESTPROTO="-4" IDLETEST=false +# Check to see if netperf is installed and exit if not +if ! command -v netperf >/dev/null 2>&1; then + echo "" + echo "Error: netperf is not installed or not in PATH" >&2 + exit 1 +fi + # read the options # extract options and their arguments into variables. @@ -287,6 +294,7 @@ if $IDLETEST then echo "$DATE Testing idle line while pinging $PINGHOST ($TESTDUR seconds)" SPEEDFILE=$(mktemp /tmp/netperfUL.XXXXXX) || exit 1 + ERRFILE=$(mktemp /tmp/netperfErr.XXXXXX) || exit 1 start_pings sleep "$TESTDUR" summarize_pings "$PINGFILE" diff --git a/netperfrunner.sh b/netperfrunner.sh index 3b90e57..05477d2 100755 --- a/netperfrunner.sh +++ b/netperfrunner.sh @@ -186,6 +186,13 @@ done # Start main test +# Check to see if netperf is installed and exit if not +if ! command -v netperf >/dev/null 2>&1; then + echo "" + echo "Error: netperf is not installed or not in PATH" >&2 + exit 1 +fi + if [ $TESTPROTO -eq "-4" ] then PROTO="ipv4" diff --git a/networkhammer.sh b/networkhammer.sh deleted file mode 100644 index 050acd8..0000000 --- a/networkhammer.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# Continuously hammer the network with continuous netperfrunner tests -# Initially created to put load on Wi-Fi for CeroWrt -# - -echo "Hammering the network to gw.home.lan. Hit Ctl-C to cancel" -while true; -do - ./netperfrunner.sh -H gw.home.lan -done