diff options
author | 2024-06-09 18:39:08 +0100 | |
---|---|---|
committer | 2024-06-09 18:39:08 +0100 | |
commit | a423a9d08a2c365cc3371c576987aa6c3f84b9df (patch) | |
tree | e62f65f756179c6b50ac601603d8e7ec3c4a23ea | |
parent | Allow for manually setting which inotify events to wait for (diff) |
Set additional args correctly to factor in bash scoping
-rwxr-xr-x | monitor.sh | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -15,14 +15,7 @@ else fi; fi; -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" +ADDITIONAL_ARGS=$(if [[ -n "$WATCH_EVENTS" ]]; then echo "-e $WATCH_EVENTS"; else echo ""; fi) while inotifywait $ADDITIONAL_ARGS -r /opt/monitor; do $HOOK_SCRIPT |