diff --git a/inotifreload.sh b/inotifreload.sh index 21e95ff..c442d28 100755 --- a/inotifreload.sh +++ b/inotifreload.sh @@ -13,7 +13,11 @@ while true; do 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 -r /hacfg/$HASVC /hacfg/certs 2>&1 >/dev/null + if [ -d /hacfg/certs ]; then + inotifywait -t 10 -q -e close_write,moved_to,create -r /hacfg/$HASVC /hacfg/certs 2>&1 >/dev/null + else + inotifywait -t 10 -q -e close_write,moved_to,create /hacfg/$HASVC 2>&1 >/dev/null + fi #If the config or certificate store did not really change don't do anything diff /hacfg/$HASVC /etc/haproxy/$HASVC 2>&1 >/dev/null