Add a check for localhost in product-configuration

This commit is contained in:
Evgeniy Antonyuk 2023-09-21 16:52:16 +04:00
parent 203fdc0695
commit 420a620727

View File

@ -38,6 +38,7 @@ REDIS_PORT="6379"
JSON="json -I -f"
[ $(id -u) -ne 0 ] && { echo "Root privileges required"; exit 1; }
check_localhost() { [ "$1" = "localhost" ] || [ "$1" = "127.0.0.1" ] && return 1 || return 0; }
while [ "$1" != "" ]; do
case $1 in
@ -66,7 +67,7 @@ while [ "$1" != "" ]; do
-esh | --elastichost )
if [ "$2" != "" ]; then
ELK_HOST=$2
EXTERNAL_ELK_FLAG="true"
check_localhost "$ELK_HOST" && EXTERNAL_ELK_FLAG="true"
shift
fi
;;
@ -116,7 +117,7 @@ while [ "$1" != "" ]; do
-rdh | --redishost )
if [ "$2" != "" ]; then
REDIS_HOST=$2
EXTERNAL_REDIS_FLAG="true"
check_localhost "$REDIS_HOST" && EXTERNAL_REDIS_FLAG="true"
shift
fi
;;
@ -131,7 +132,7 @@ while [ "$1" != "" ]; do
-rbh | --rabbitmqhost )
if [ "$2" != "" ]; then
RABBITMQ_HOST=$2
EXTERNAL_RABBITMQ_FLAG="true"
check_localhost "$REDIS_HOST" && EXTERNAL_RABBITMQ_FLAG="true"
shift
fi
;;