Эх сурвалжийг харах

Switch from grep to egrep to prevent multiple detections.

(cherry picked from commit efb01295824b1df12b478aef60745b400ece0c9d)
Raphael Schneeberger 6 жил өмнө
parent
commit
c1e20d91cf

+ 2 - 2
bin/v-add-letsencrypt-domain

@@ -254,11 +254,11 @@ for auth in $authz; do
                 # Get root directory from configuration
                 domain_config="$HOMEDIR/$user/conf/web/$domain"
                 if [ -f "${domain}_config/nginx.conf" ]; then
-                    well_known="$(cat ${domain}_config/nginx.conf | grep root | \
+                    well_known="$(cat ${domain}_config/nginx.conf | egrep '^\s+root'| \
                                 awk '{split($0, a, " "); print a[2]}' | \
                                 sed 's/;$//')/.well-known"
                 else
-                    well_known="$(cat ${domain}_config/apache2.conf | grep root | \
+                    well_known="$(cat ${domain}_config/apache2.conf | egrep '^\s+root'| \
                                 awk '{split($0, a, " "); print a[2]}' | \
                                 sed 's/;$//')/.well-known"
                 fi