Skip to content

Commit

Permalink
Inotify on the whole Configuration Directory not just the configfile
Browse files Browse the repository at this point in the history
  • Loading branch information
acaranta committed Apr 19, 2021
1 parent 705a44f commit f6ac51d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inotifreload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ while true; do
haproxy -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/$HASVC -D -p /run/haproxy.pid
fi
#start an inotifywait (timeout -s <#> seconds)
inotifywait -t 10 -q -e close_write,moved_to,create /hacfg/$HASVC 2>&1 >/dev/null
#inotifywait -t 10 -q -e close_write,moved_to,create /hacfg/$HASVC 2>&1 >/dev/null
inotifywait -t 10 -q -e close_write,moved_to,create -r /hacfg 2>&1 >/dev/null

#If the file did not really change don't do anything
diff /hacfg/$HASVC /etc/haproxy/$HASVC 2>&1 >/dev/null
Expand Down

0 comments on commit f6ac51d

Please sign in to comment.