mirror of
https://github.com/richb-hanover/OpenWrtScripts.git
synced 2026-03-30 10:44:32 +02:00
Merge pull request #5 from aidanharris/master
Make sure ping uses ipv4 when $TESTPROTO equals -4 (OpenWrt ping may use v4 or v6, depending on the DNS resolution, so force it to use `ping4`). But macOS doesn't implement `ping4`, requiring the special case
This commit is contained in:
commit
44d1102cde
3 changed files with 21 additions and 6 deletions
|
|
@ -114,9 +114,9 @@ start_pings() {
|
|||
# Start Ping
|
||||
if [ $TESTPROTO -eq "-4" ]
|
||||
then
|
||||
ping $PINGHOST > $PINGFILE &
|
||||
"${PING4}" $PINGHOST > $PINGFILE &
|
||||
else
|
||||
ping6 $PINGHOST > $PINGFILE &
|
||||
"${PING6}" $PINGHOST > $PINGFILE &
|
||||
fi
|
||||
ping_pid=$!
|
||||
# echo "Ping PID: $ping_pid"
|
||||
|
|
@ -186,6 +186,11 @@ measure_direction() {
|
|||
# set an initial values for defaults
|
||||
TESTHOST="netperf.bufferbloat.net"
|
||||
TESTDUR="60"
|
||||
|
||||
PING4=ping
|
||||
command -v ping4 > /dev/null 2>&1 && PING4=ping4
|
||||
PING6=ping6
|
||||
|
||||
PINGHOST="gstatic.com"
|
||||
MAXSESSIONS="5"
|
||||
TESTPROTO="-4"
|
||||
|
|
|
|||
|
|
@ -108,9 +108,9 @@ start_pings() {
|
|||
# Start Ping
|
||||
if [ $TESTPROTO -eq "-4" ]
|
||||
then
|
||||
ping $PINGHOST > $PINGFILE &
|
||||
"${PING4}" $PINGHOST > $PINGFILE &
|
||||
else
|
||||
ping6 $PINGHOST > $PINGFILE &
|
||||
"${PING6}" $PINGHOST > $PINGFILE &
|
||||
fi
|
||||
ping_pid=$!
|
||||
# echo "Ping PID: $ping_pid"
|
||||
|
|
@ -127,6 +127,11 @@ start_pings() {
|
|||
|
||||
# set an initial values for defaults
|
||||
TESTDUR="60"
|
||||
|
||||
PING4=ping
|
||||
command -v ping4 > /dev/null 2>&1 && PING4=ping4
|
||||
PING6=ping6
|
||||
|
||||
PINGHOST="gstatic.com"
|
||||
TESTPROTO="-4"
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,11 @@ summarize_pings() {
|
|||
# set an initial values for defaults
|
||||
TESTHOST="netperf.bufferbloat.net"
|
||||
TESTDUR="60"
|
||||
|
||||
PING4=ping
|
||||
command -v ping4 > /dev/null 2>&1 && PING4=ping4
|
||||
PING6=ping6
|
||||
|
||||
PINGHOST="gstatic.com"
|
||||
MAXSESSIONS=4
|
||||
TESTPROTO=-4
|
||||
|
|
@ -132,9 +137,9 @@ echo "$DATE Testing $TESTHOST ($PROTO) with $MAXSESSIONS streams down and up whi
|
|||
# Start Ping
|
||||
if [ $TESTPROTO -eq "-4" ]
|
||||
then
|
||||
ping $PINGHOST > $PINGFILE &
|
||||
"${PING4}" $PINGHOST > $PINGFILE &
|
||||
else
|
||||
ping6 $PINGHOST > $PINGFILE &
|
||||
"${PING6}" $PINGHOST > $PINGFILE &
|
||||
fi
|
||||
ping_pid=$!
|
||||
# echo "Ping PID: $ping_pid"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue