diff --git a/validate_workflow.sh b/validate_workflow.sh index 6a94bc47c4f187dd5a02d0343931bdd365d6fc2e..85fb37ad7f7b03619394053cfca8f34f800dc81e 100755 --- a/validate_workflow.sh +++ b/validate_workflow.sh @@ -397,8 +397,17 @@ if [ "$WITH_PIPE" -eq 1 ]; then rm -f "$filename" || error "could not remove temporary file '$filename'" else if [ "$WITH_DAEMON" -eq 1 ]; then + # TODO: protect DAEMON from STRG-C for clean shutdown # echo daemon mode, use inotify to watch changes debug "starting daemon" + scan_dir "$WATCH_FOLDER" # to clean up existing files + /usr/bin/inotifywait --monitor --recursive --event create \ + --event attrib --event moved_to --format "%w%f" "$WATCH_FOLDER" \ + | while read -r filename; do + debug "called inotifywait using /usr/bin/inotifywait --monitor + --recursive --event create --event attrib --event moved_to --format '%f' $WATCH_FOLDER" + scan_file "$filename" + done debug "stopping daemon" else # cli mode, scan watch folder once