diff options
author | 2024-06-09 18:30:24 +0100 | |
---|---|---|
committer | 2024-06-09 18:30:24 +0100 | |
commit | 36265dd1ac5df48b740885633f5df6d08094e890 (patch) | |
tree | 472aee55fd18ef90b31eb4b3252d3e229e699e3f | |
parent | Add workflow for building and publishing image (diff) |
Allow for manually setting which inotify events to wait for
-rwxr-xr-x | monitor.sh | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -13,8 +13,17 @@ else echo "HOOK_SCRIPT is not an executable file (missing +x bit), check file permissions of the hook script." exit 1; fi; -fi +fi; -while inotifywait -r /opt/monitor; do +ADDITIONAL_ARGS="" + +if [ -z ${WATCH_EVENTS+x} ]; then + echo "Found watch events" + ADDITIONAL_ARGS="-e $WATCH_EVENTS" +fi; + +echo "Final command: inotifywait $ADDITIONAL_ARGS -r /opt/monitor" + +while inotifywait $ADDITIONAL_ARGS -r /opt/monitor; do $HOOK_SCRIPT done; |