Skip to content

Commit

Permalink
Moved RELOAD declaration in the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
acaranta committed Apr 20, 2021
1 parent c812991 commit ccb36bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inotifreload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ haproxy -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/$HASVC -D -p /run/haproxy.pi
# watch for changes in /mnt and update nginx if there is one on /mnt/proxy
echo "$(date) - Starting inotify loop"
while true; do
RELOAD=0
#Check if haproxy is still running
if ! kill -0 $(cat /run/haproxy.pid) ; then
haproxy -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/$HASVC -D -p /run/haproxy.pid
Expand Down Expand Up @@ -36,6 +37,5 @@ while true; do
#if it changed, then copy it and reload properly haproxy
haproxy -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/$HASVC -D -p /run/haproxy.pid -sf $(cat /run/haproxy.pid)
fi
RELOAD=0

done

0 comments on commit ccb36bf

Please sign in to comment.