Also sort result of inotifywait.

This commit is contained in:
redxef 2023-08-19 02:56:15 +02:00
parent 50393ac177
commit a1f8d62549
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

View file

@ -43,7 +43,7 @@ run_inotifywait() {
echo "monitoring the following files:"
echo "$wait_files"
matched_files="$(echo "$wait_directories" | inotifywait --fromfile=- -e close_write -e modify -e create)"
if [[ -n "$(comm -12 <(echo "$matched_files") <(echo "$wait_files"))" ]]; then
if [[ -n "$(comm -12 <(sort <<< "$matched_files") <(echo "$wait_files"))" ]]; then
nginx -s reload
fi
done