From e2620d2f32dd901e62e362cabdd20e83882776a7 Mon Sep 17 00:00:00 2001 From: James MacMahon Date: Mon, 19 Nov 2018 23:48:32 -0500 Subject: [PATCH] use "curl -L" to follow redirects during subdomain check also write out http_code to avoid using grep to check for 200 --- Linux Script/configure-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Linux Script/configure-linux.sh b/Linux Script/configure-linux.sh index 868bc15..c0a04ac 100644 --- a/Linux Script/configure-linux.sh +++ b/Linux Script/configure-linux.sh @@ -354,7 +354,7 @@ checkIfLogglyServersAccessible() { echo "INFO: Checking if '$LOGGLY_ACCOUNT' subdomain is valid." if [[ $LOGGLY_ACCOUNT != $INVALID_SUBDOMAIN ]]; then - if [[ $(curl --head -s --request GET $LOGGLY_ACCOUNT_URL/login | grep "200 OK\|HTTP/2 200") ]]; then + if [[ $(curl -L -s --head --request GET $LOGGLY_ACCOUNT_URL/login -w '%{http_code}' -o /dev/null) == "200" ]]; then echo "INFO: $LOGGLY_ACCOUNT_URL is valid and reachable." else logMsgToConfigSysLog "ERROR" "ERROR: This is not a recognized subdomain. Please ask the account owner for the subdomain they signed up with."