From c3c547b82fd6255df45124874c681662a6335914 Mon Sep 17 00:00:00 2001 From: gyurix Date: Thu, 23 Sep 2021 16:04:53 +0200 Subject: [PATCH] Added proxy type variable. --- scripts/check_proxy_state.sh | 17 +++++++---------- scripts/scheduler.sh | 7 +++++++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/scripts/check_proxy_state.sh b/scripts/check_proxy_state.sh index 47015f7..d6cb63a 100755 --- a/scripts/check_proxy_state.sh +++ b/scripts/check_proxy_state.sh @@ -148,6 +148,13 @@ elif [[ "$RUNNING_CONTAINERS" -eq 1 ]] ; then fi fi done +fi + +} # end of check_proxy_state + + +# call method +check_proxy_state # sleep $TIMEOUT; @@ -165,13 +172,3 @@ elif [[ "$RUNNING_CONTAINERS" -eq 1 ]] ; then # done; - -fi - -} # end of check_proxy_state - - -# call method -check_proxy_state - - diff --git a/scripts/scheduler.sh b/scripts/scheduler.sh index d092e72..0e344d8 100755 --- a/scripts/scheduler.sh +++ b/scripts/scheduler.sh @@ -5,6 +5,7 @@ DATE=`date +%F-%H-%M-%S` # Set env variables +PROXY_TYPE=$PROXY_TYPE DOMAIN_DIR=$DOMAIN_DIR CERT_DIR=$CERT_DIR PROXY_CONFIG_DIR=$PROXY_CONFIG_DIR @@ -37,6 +38,12 @@ do elif [[ "${parent}" == "${DOMAIN_DIR}" && "${op}" == "CLOSE_WRITE,CLOSE" ]]; then DOMAIN=$(echo $file); + + if [[ "${PROXY_TYPE}" == "haproxy" ]]; then + echo "haproxy config created, changed"; + /scripts/config_haproxy_generate.sh; + fi + echo "domain config created, changed"; /scripts/nginx_config_create.sh "$DOMAIN";