From 4d069c869694647a445a2e39ca37fdbb9678b693 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 3 Jul 2017 01:02:47 +0200 Subject: [PATCH] Support new output format of 'ifconfig'-command. --- create_vhost_php.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/create_vhost_php.sh b/create_vhost_php.sh index a211fe4..59913e6 100755 --- a/create_vhost_php.sh +++ b/create_vhost_php.sh @@ -165,8 +165,13 @@ _major_php_verisons=`echo "$__major_php_verisons" | sed 's/^ *//'` # - Determin IP Addresses # - -__ipv4="`ifconfig | grep -e \"^\s*inet Adresse\" | grep -v \"127.0.0.1\" | awk '{print$2}' | cut -d\":\" -f2 | sort | head -1`" -__ipv6="`ifconfig | grep -e \"^\s*inet6-Adresse\" | awk '{print$2}' | grep -v -e \"^::1/\" | grep -v -e \"^fe80\" | cut -d\"/\" -f1 | sort | head -1`" +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 | head -1`" + __ipv6="`ifconfig | grep -e \"^\s*inet6-Adresse\" | awk '{print$2}' | grep -v -e \"^::1/\" | grep -v -e \"^fe80\" | cut -d\"/\" -f1 | sort | head -1`" +else + __ipv4="`ifconfig | grep -e \"^\s*inet \" | grep -v \"127.0.0.1\" | awk '{print$2}' | sort | head -1`" + __ipv6="`ifconfig | grep -e \"^\s*inet6 \" | awk '{print$2}' | grep -v \"^::1\" | grep -v -e \"^fe80\" | sort | head -1`" +fi # - Determin httpd binary # -