Don't search /etc/nginx if it doesn't exist

This commit is contained in:
Jérémy Lecour 2020-04-28 11:18:17 +02:00 committed by Jérémy Lecour
parent d95275a23a
commit 3d0e632dec

View file

@ -1264,7 +1264,9 @@ check_chrooted_binary_uptodate() {
done
}
check_nginx_letsencrypt_uptodate() {
if [ -d /etc/nginx ]; then
snippets=$(find /etc/nginx -type f -name "letsencrypt.conf")
if [ -n "${snippets}" ]; then
while read -r snippet; do
if is_debian_jessie; then
if ! grep -qE "^\s*alias\s+/.+/\.well-known/acme-challenge" "${snippet}"; then
@ -1275,7 +1277,9 @@ check_nginx_letsencrypt_uptodate() {
failed "IS_NGINX_LETSENCRYPT_UPTODATE" "Nginx snippet ${snippet} is not compatible with Nginx on Debian 9+."
fi
fi
done <<< "$snippets"
done <<< "${snippets}"
fi
fi
}
main() {