Skip to content

Commit

Permalink
Set additional args correctly to factor in bash scoping
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Jun 9, 2024
1 parent 36265dd commit a423a9d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a423a9d

Please sign in to comment.