testminiwget.sh: use either "ip addr" or "ifconfig -a"
# $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,6 +23,12 @@ DOWNLOADEDFILE="${TMPD}/downloadedfile"
PORT=
RET=0
IPCONFIG=$(which ifconfig)
+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
@@ -30,6 +36,7 @@ fi
if ! $IPCONFIG -a | grep inet6 ; then
HAVE_IPV6=no
fi
+fi
case "$HAVE_IPV6" in
n|no|0)
