testminiwget.sh: use either "ip addr" or "ifconfig -a"
This commit is contained in:
parent
5f85321084
commit
efb6ec1b2f
|
@ -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
|
||||
|
||||
if ! $IPCONFIG -a | grep inet6 ; then
|
||||
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
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$HAVE_IPV6" in
|
||||
|
|
Loading…
Reference in New Issue