Skip to content

Commit 32bd56c

Browse files
author
Ubuntu
committed
Resolve invalid subdomain issue
1 parent e466a70 commit 32bd56c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Linux Script/configure-linux.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function ctrl_c() {
1515
#name of the current script. This will get overwritten by the child script which calls this
1616
SCRIPT_NAME=configure-linux.sh
1717
#version of the current script. This will get overwritten by the child script which calls this
18-
SCRIPT_VERSION=1.20
18+
SCRIPT_VERSION=1.21
1919

2020
#application tag. This will get overwritten by the child script which calls this
2121
APP_TAG=
@@ -104,6 +104,9 @@ LOGGLY_REMOVE="false"
104104
#Setting INSECURE mode to false initially
105105
INSECURE_MODE="false"
106106

107+
#Setting invalid subdomain value
108+
INVALID_SUBDOMAIN=*".loggly.com"*
109+
107110
########## Variable Declarations - End ##########
108111

109112
#check if the Linux environment is compatible with Loggly.
@@ -350,10 +353,15 @@ checkIfLogglyServersAccessible() {
350353
fi
351354

352355
echo "INFO: Checking if '$LOGGLY_ACCOUNT' subdomain is valid."
353-
if [ $(curl --head -s --request GET $LOGGLY_ACCOUNT_URL/login | grep "200 OK\|HTTP/2 200" | wc -l) ] >0; then
354-
echo "INFO: $LOGGLY_ACCOUNT_URL is valid and reachable."
356+
if [[ $LOGGLY_ACCOUNT != $INVALID_SUBDOMAIN ]]; then
357+
if [[ $(curl --head -s --request GET $LOGGLY_ACCOUNT_URL/login | grep "200 OK\|HTTP/2 200") ]]; then
358+
echo "INFO: $LOGGLY_ACCOUNT_URL is valid and reachable."
359+
else
360+
logMsgToConfigSysLog "ERROR" "ERROR: This is not a recognized subdomain. Please ask the account owner for the subdomain they signed up with."
361+
exit 1
362+
fi
355363
else
356-
logMsgToConfigSysLog "ERROR" "ERROR: This is not a recognized subdomain. Please ask the account owner for the subdomain they signed up with."
364+
logMsgToConfigSysLog "ERROR" "ERROR: This is not a recognized subdomain. Please ask the account owner for the subdomain they signed up with. Please note that your subdomain is just the first string in your loggly account URL not the entire account name."
357365
exit 1
358366
fi
359367

0 commit comments

Comments
 (0)