testminiwget.sh: use either "ip addr" or "ifconfig -a"

This commit is contained in:
Thomas Bernard 2019-10-22 14:35:15 +02:00 committed by BERNARD Thomas
parent 5f85321084
commit efb6ec1b2f
1 changed files with 13 additions and 6 deletions

View File

@ -2,7 +2,7 @@
# $Id: testminiwget.sh,v 1.15 2017/11/02 17:36:26 nanard Exp $
# vim: tabstop=4 shiftwidth=4 noexpandtab
# project miniupnp : http://miniupnp.free.fr/
# (c) 2011-2018 Thomas Bernard
# (c) 2011-2019 Thomas Bernard
#
# test program for miniwget.c
# is usually invoked by "make check"
@ -23,12 +23,19 @@ DOWNLOADEDFILE="${TMPD}/downloadedfile"
PORT=
RET=0
IPCONFIG=$(which ifconfig)
if [ -z "$IPCONFIG" ] ; then
IPCONFIG="/sbin/ifconfig"
fi
IP=$(which ip)
if [ "$IP" ] ; then
if ! $IP addr | grep inet6 ; then
HAVE_IPV6=no
fi
else
if [ -z "$IPCONFIG" ] ; then
IPCONFIG="/sbin/ifconfig"
fi
if ! $IPCONFIG -a | grep inet6 ; then
HAVE_IPV6=no
if ! $IPCONFIG -a | grep inet6 ; then
HAVE_IPV6=no
fi
fi
case "$HAVE_IPV6" in