Inotify trigger change to CLOSE_WRITE,CLOSE only
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user