From 59962b17f454c135733003033668a5b354d9bf5d Mon Sep 17 00:00:00 2001 From: acaranta Date: Wed, 21 Apr 2021 23:45:40 +0200 Subject: [PATCH] Changed inotify if cerets dir exists or not --- inotifreload.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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