aboutsummaryrefslogtreecommitdiffstats
path: root/monitor.sh
diff options
context:
space:
mode:
Diffstat (limited to 'monitor.sh')
-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;