From 94be224b6eb43b82c598548c02fe642f45899b2b Mon Sep 17 00:00:00 2001 From: "root@culturestrings" Date: Mon, 13 Jul 2020 19:35:31 +0000 Subject: nginx: vhost config-file generation: obtain list of sub-folders more elegantly. --- public/fs/etc/nginx/vhosts.d/nginx-primary-subdomain-cfg.sh | 5 ++--- public/fs/etc/nginx/vhosts.d/nginx-primary-zone-cfg.sh | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'public/fs') diff --git a/public/fs/etc/nginx/vhosts.d/nginx-primary-subdomain-cfg.sh b/public/fs/etc/nginx/vhosts.d/nginx-primary-subdomain-cfg.sh index 748360e..20a067f 100755 --- a/public/fs/etc/nginx/vhosts.d/nginx-primary-subdomain-cfg.sh +++ b/public/fs/etc/nginx/vhosts.d/nginx-primary-subdomain-cfg.sh @@ -4,8 +4,7 @@ set -eu IFS=',' -sitesubd="$1" -sitedirs="$2" +sitesubd="$1"; shift; sitezone="${sitesubd#*.}" sitepref="${sitesubd%%.*}" @@ -27,7 +26,7 @@ server { _EOF # indexed locations -for sitedir in ${sitedirs}; do +for sitedir in $@; do cat << _EOF location /${sitedir} { diff --git a/public/fs/etc/nginx/vhosts.d/nginx-primary-zone-cfg.sh b/public/fs/etc/nginx/vhosts.d/nginx-primary-zone-cfg.sh index f325fe1..986ae07 100755 --- a/public/fs/etc/nginx/vhosts.d/nginx-primary-zone-cfg.sh +++ b/public/fs/etc/nginx/vhosts.d/nginx-primary-zone-cfg.sh @@ -4,9 +4,7 @@ set -eu IFS=',' -sitezone="$1" -sitedirs="$2" - +sitezone="$1"; shift; cfg_script="$0" cfg_srcdir=$(cd -- "${cfg_script%/*}/" ; pwd -P) @@ -25,7 +23,7 @@ server { _EOF # indexed locations -for sitedir in ${sitedirs}; do +for sitedir in $@; do cat << _EOF location /${sitedir} { -- cgit v1.2.3