diff options
author | root@culturestrings <root@culturestrings> | 2020-07-13 19:35:31 +0000 |
---|---|---|
committer | root@culturestrings <root@culturestrings> | 2020-07-13 19:43:35 +0000 |
commit | 94be224b6eb43b82c598548c02fe642f45899b2b (patch) | |
tree | d6c33c09207a548f5f4e75605288ff5a1387efa9 | |
parent | a75d12f964f0d3b77d041ef310c991631097ff0e (diff) | |
download | culturestrings-94be224b6eb43b82c598548c02fe642f45899b2b.tar.bz2 culturestrings-94be224b6eb43b82c598548c02fe642f45899b2b.tar.xz |
nginx: vhost config-file generation: obtain list of sub-folders more elegantly.
-rwxr-xr-x | public/fs/etc/nginx/vhosts.d/nginx-primary-subdomain-cfg.sh | 5 | ||||
-rwxr-xr-x | public/fs/etc/nginx/vhosts.d/nginx-primary-zone-cfg.sh | 6 |
2 files changed, 4 insertions, 7 deletions
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} { |