Correcting domain name variable in check_proxy_state method

This commit is contained in:
2022-06-16 08:52:09 +00:00
parent 9e588d156d
commit 7d9a18e5db
3 changed files with 10 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ ROLE=$ROLE
SERVICE_NAME=$SERVICE_NAME
PROXY_CONFIG_DIR=$PROXY_CONFIG_DIR
# Setup docker registry url path
if [[ -n "$DOCKER_REGISTRY_URL" && "$DOCKER_REGISTRY_URL" != "null" ]] ; then
@@ -168,6 +169,7 @@ fi
# call method
check_proxy_state
echo "PROXY RESTARTED SUCCESSFULY"
# in case of new proxy configuration generated needed to copy the domain name to the configs file.then remove new_config flag.
if [[ -f $PROXY_CONFIG_DIR/new_config ]] ; then
if [[ ! -f $PROXY_CONFIG_DIR/config || "$(grep $DOMAIN $PROXY_CONFIG_DIR/config 2>/dev/null)" == "" ]] ; then

View File

@@ -25,7 +25,6 @@ ALLOWED_NETWORK=$(jq -r '.ALLOWED_NETWORK | select(.!="null") | join(" ")' $DOMA
ALTERNATE_LOCATION_PATH=$(jq -r .ALTERNATE_LOCATION_PATH $DOMAIN_SOURCE)
# check whether certificates exist or not
if [[ "$HTTPS_PORT" != "" ]]; then
/scripts/check_certificates.sh "$DOMAIN";
fi

View File

@@ -31,6 +31,7 @@ do
fi
elif [[ "${parent}" == "${DOMAIN_DIR}" && "${op}" == "CLOSE_WRITE,CLOSE" ]]; then
DOMAIN=$(echo $file);
if [[ "${PROXY_TYPE}" == "haproxy" ]]; then
@@ -42,9 +43,13 @@ do
fi
elif [[ "${parent}" == "${PROXY_CONFIG_DIR}" && "${op}" == "CLOSE_WRITE,CLOSE" ]]; then
if [[ $file != "new_config" && $file != "config" ]]; then
DOMAIN=$(echo "${file%.*}");
if [ -f "$PROXY_CONFIG_DIR/new_config" ] ; then
/scripts/check_proxy_state.sh "$DOMAIN";
fi
fi;
elif [[ "${parent}" == "${DOMAIN_DIR}" && "${op}" == "DELETE" ]] ; then
DOMAIN=$(echo $file);