@@ -83,7 +83,7 @@ update_certs() {
83
83
acme_ca_uri=" https://acme-staging.api.letsencrypt.org/directory"
84
84
if [[ ! -f /etc/nginx/certs/.${base_domain} .test ]]; then
85
85
# Remove old certificates
86
- rm -rf /etc/nginx/certs/${base_domain}
86
+ [[ -n " ${base_domain // } " ]] && rm -rf /etc/nginx/certs/${base_domain}
87
87
for domain in " ${! hosts_array} " ; do
88
88
rm -f /etc/nginx/certs/$domain .{crt,key,dhparam.pem}
89
89
done
@@ -93,7 +93,7 @@ update_certs() {
93
93
acme_ca_uri=" $ACME_CA_URI "
94
94
if [[ -f /etc/nginx/certs/.${base_domain} .test ]]; then
95
95
# Remove old test certificates
96
- rm -rf /etc/nginx/certs/${base_domain}
96
+ [[ -n " ${base_domain // } " ]] && rm -rf /etc/nginx/certs/${base_domain}
97
97
for domain in " ${! hosts_array} " ; do
98
98
rm -f /etc/nginx/certs/$domain .{crt,key,dhparam.pem}
99
99
done
@@ -127,7 +127,7 @@ update_certs() {
127
127
128
128
for altnames in " ${hosts_array_expanded[@]: 1} " ; do
129
129
# Remove old CN domain that now are altnames
130
- rm -rf /etc/nginx/certs/$altnames
130
+ [[ -n " ${altnames // } " ]] && rm -rf /etc/nginx/certs/${ altnames}
131
131
done
132
132
133
133
for domain in " ${! hosts_array} " ; do
0 commit comments