aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-06-09 18:30:24 +0100
committerGravatar Joe Banks <[email protected]>2024-06-09 18:30:24 +0100
commit36265dd1ac5df48b740885633f5df6d08094e890 (patch)
tree472aee55fd18ef90b31eb4b3252d3e229e699e3f
parentAdd workflow for building and publishing image (diff)
Allow for manually setting which inotify events to wait for
-rwxr-xr-xmonitor.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/monitor.sh b/monitor.sh
index 6bf4236..9af6f19 100755
--- a/monitor.sh
+++ b/monitor.sh
@@ -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;