From d65fd605df5a3e999d5c7b0432045d6aff06745b Mon Sep 17 00:00:00 2001 From: gyurix Date: Sun, 16 May 2021 11:46:41 +0200 Subject: [PATCH] Inotify trigger change to CLOSE_WRITE,CLOSE only --- scripts/scheduler.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/scheduler.sh b/scripts/scheduler.sh index c14d963..9da500a 100755 --- a/scripts/scheduler.sh +++ b/scripts/scheduler.sh @@ -7,11 +7,11 @@ service_exec=echo CERT_DIR=/keys -inotifywait --exclude .swp -m -e modify,create -r $CERT_DIR | \ +inotifywait --exclude .swp -m -e CLOSE_WRITE,CLOSE -r $CERT_DIR | \ while read dir op file do - if [[ "${op}" == "CLOSE_WRITE,CLOSE" || "${op}" == "CREATE" ]] ; then + if [[ "${op}" == "CLOSE_WRITE,CLOSE" ]] ; then DOMAIN=$(echo $dir|cut -d / -f3) FILE=$(find /etc/user/config/services/ -name *.json | xargs -I {} jq '{"file": input_filename, "MAIN": ..|.main?'} {} | jq -c 'select(.MAIN | length > 0)' | grep $DOMAIN | jq -r .file)