diff --git a/scripts/check_proxy_state.sh b/scripts/check_proxy_state.sh index 5315450..e8080eb 100755 --- a/scripts/check_proxy_state.sh +++ b/scripts/check_proxy_state.sh @@ -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 diff --git a/scripts/nginx_config_create.sh b/scripts/nginx_config_create.sh index 7362c60..9ba454d 100755 --- a/scripts/nginx_config_create.sh +++ b/scripts/nginx_config_create.sh @@ -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 diff --git a/scripts/scheduler.sh b/scripts/scheduler.sh index c2622e1..3fbda24 100755 --- a/scripts/scheduler.sh +++ b/scripts/scheduler.sh @@ -31,8 +31,9 @@ do fi elif [[ "${parent}" == "${DOMAIN_DIR}" && "${op}" == "CLOSE_WRITE,CLOSE" ]]; then - DOMAIN=$(echo $file); - + + DOMAIN=$(echo $file); + if [[ "${PROXY_TYPE}" == "haproxy" ]]; then echo "haproxy config created, changed"; /scripts/config_haproxy_create.sh $DOMAIN; @@ -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 + fi; elif [[ "${parent}" == "${DOMAIN_DIR}" && "${op}" == "DELETE" ]] ; then DOMAIN=$(echo $file);