From 45f35f6b4732ebeca313429f870d9da62126ff3f Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 9 Jun 2017 23:26:14 +0200 Subject: [PATCH] Systems 'ifconfig' changed. --- install_httpd-2.4.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install_httpd-2.4.sh b/install_httpd-2.4.sh index 06f1433..3c1048d 100755 --- a/install_httpd-2.4.sh +++ b/install_httpd-2.4.sh @@ -31,23 +31,23 @@ _PHP_VERSION=7.1.2 ## - Determin IP-Adresses ## - -__ipv4="`ifconfig | grep -e \"^\s*inet Adresse\" | grep -v \"127.0.0.1\" | awk '{print$2}' | cut -d\":\" -f2 | sort`" +if ifconfig | grep -i -q -E "inet [address|Adresse]:" ; then + __ipv4="`ifconfig | grep -e \"^\s*inet Adresse\" | grep -v \"127.0.0.1\" | awk '{print$2}' | cut -d\":\" -f2 | sort`" + __ipv6="`ifconfig | grep -e \"^\s*inet6-Adresse\" | awk '{print$2}' | grep -v -e \"^::1/\" | grep -v -e \"^fe80\" | cut -d\"/\" -f1 | sort`" +else + __ipv4="`ifconfig | grep -e \"^\s*inet \" | grep -v \"127.0.0.1\" | awk '{print$2}' | sort`" + __ipv6="`ifconfig | grep -e \"^\s*inet6 \" | awk '{print$2}' | grep -v \"^::1\" | grep -v -e \"^fe80\" | sort`" +fi for _ip in $__ipv4 ; do _ipv4="$_ipv4 $_ip" done -## - Trim leading whitespaces -## - -shopt -s extglob -_ipv4="${_ipv4##*( )}" -shopt -u extglob - -__ipv6="`ifconfig | grep -e \"^\s*inet6-Adresse\" | awk '{print$2}' | grep -v -e \"^::1/\" | grep -v -e \"^fe80\" | cut -d\"/\" -f1 | sort`" for _ip in $__ipv6 ; do _ipv6="$_ipv6 $_ip" done ## - Trim leading whitespaces ## - shopt -s extglob +_ipv4="${_ipv4##*( )}" _ipv6="${_ipv6##*( )}" shopt -u extglob