diff --git a/scripts/scheduler/inotify.sh b/scripts/scheduler/inotify.sh new file mode 100644 index 0000000..6c2c8f3 --- /dev/null +++ b/scripts/scheduler/inotify.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Initial parameters +DATE=$(date +%F-%H-%M-%S) + +# Set env variables +DIR=$DIR + +# Triggers by certificate or domain config changes + +unset IFS + +inotifywait --exclude "\.(swp|tmp)" -m -e CREATE,CLOSE_WRITE,DELETE,MOVED_TO -r $DIR | + while read dir op file; do + if [ "${op}" == "CLOSE_WRITE,CLOSE" ]; then + echo "new file created: $file" + fi + done