From e9c01255da1493c88970d911b11544fbf85ace48 Mon Sep 17 00:00:00 2001 From: Christian Witts Date: Tue, 23 Oct 2018 14:55:27 +0200 Subject: [PATCH] Fix install issue with default hostname commented Update the `grep` filter to anchor at the start of the line and allow for whitespace characters, in order to correctly determine the hostname being set if the default is merely commented out and the custom one added, instead of overridden. Fixes #6117 Signed-off-by: Christian Witts --- make/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/install.sh b/make/install.sh index bfa5b8980..e8e2aa7b1 100755 --- a/make/install.sh +++ b/make/install.sh @@ -84,7 +84,7 @@ workdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $workdir # The hostname in harbor.cfg has not been modified -if grep 'hostname = reg.mydomain.com' &> /dev/null harbor.cfg +if grep '^[[:blank:]]*hostname = reg.mydomain.com' &> /dev/null harbor.cfg then warn "$usage" exit 1 @@ -212,7 +212,7 @@ then protocol=${BASH_REMATCH[1]} fi -if [[ $(grep 'hostname[[:blank:]]*=' ./harbor.cfg) =~ hostname[[:blank:]]*=[[:blank:]]*(.*) ]] +if [[ $(grep '^[[:blank:]]*hostname[[:blank:]]*=' ./harbor.cfg) =~ hostname[[:blank:]]*=[[:blank:]]*(.*) ]] then hostname=${BASH_REMATCH[1]} fi