Skip to content

Commit

Permalink
Corrected changes detection
Browse files Browse the repository at this point in the history
  • Loading branch information
acaranta committed Dec 5, 2022
1 parent 2e2b563 commit 2fe1ef8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions inotifreload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ while true; do
do
if [[ -f /hacfg/$item || -d /hacfg/$item ]]; then
#Check if initial sync is needed
if [ ! -d /etc/haproxy/$item ]; then
rsync -ad /hacfg/$item /etc/haproxy --delete
fi
if [[ -d $PASSED ]]; then
if [ ! -d /etc/haproxy/$item ]; then
rsync -ad /hacfg/$item /etc/haproxy --delete
fi
elif [[ -f $PASSED ]]; then
if [ ! -f /etc/haproxy/$item ]; then
rsync -ad /hacfg/$item /etc/haproxy --delete
fi
fi


#Check for difference
diff /hacfg/$item /etc/haproxy/$item 2>&1 >/dev/null
Expand Down

0 comments on commit 2fe1ef8

Please sign in to comment.