From 2e5d719da822a11cecaf7c2f04e5f153e7e0f746 Mon Sep 17 00:00:00 2001 From: gyurix Date: Mon, 7 Jun 2021 12:54:53 +0000 Subject: [PATCH] Minor changes --- scripts/scheduler.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/scheduler.sh b/scripts/scheduler.sh index 9045239..cc08d95 100755 --- a/scripts/scheduler.sh +++ b/scripts/scheduler.sh @@ -23,14 +23,16 @@ inotifywait --exclude .swp -m -e CREATE,CLOSE_WRITE,CLOSE,DELETE -r $CERT_DIR $P while read dir op file do - if [[ "${dir}" == "${CERT_DIR}" && "${op}" == "CLOSE_WRITE,CLOSE" ]]; then - DOMAIN=$(echo $dir|cut -d / -f3) - echo "New cert created: '$DOMAIN'" - elif [[ "${dir}" == "${PROXY_CONFIG_DIR}" && "${op}" == "CLOSE_WRITE,CLOSE" || "${dir}" == "${PROXY_CONFIG_DIR}" && "${op}" == "CREATE" || "${dir}" == "${PROXY_CONFIG_DIR}" && "${op}" == "DELETE" ]] ; - then + if [[ "${dir}" == "${CERT_DIR}" && "${op}" == "CLOSE_WRITE" ]]; then + DOMAIN=$(echo $dir|cut -d / -f3) + echo "New cert created: '$DOMAIN'" + + elif [[ "${dir}" == "${PROXY_CONFIG_DIR}" && "${op}" == "CLOSE_WRITE" ]] || \ + [[ "${dir}" == "${PROXY_CONFIG_DIR}" && "${op}" == "CREATE" ]] || \ + [[ "${dir}" == "${PROXY_CONFIG_DIR}" && "${op}" == "DELETE" ]] ; then echo "proxy config created, changed or deleted" - fi + done # Check services with running containers by roles