Blame public/fs/etc/nginx/vhosts.d/nginx-subdomain-cfg.sh
|
root@culturestrings |
281232 |
#!/bin/sh
|
|
root@culturestrings |
281232 |
|
|
root@culturestrings |
281232 |
set -eu
|
|
root@culturestrings |
281232 |
|
|
root@culturestrings |
281232 |
sitetype="$1"
|
|
root@culturestrings |
281232 |
sitesubd="$2"
|
|
root@culturestrings |
281232 |
sitezone="${sitesubd#*.}"
|
|
root@culturestrings |
281232 |
sitepref="${sitesubd%%.*}"
|
|
root@culturestrings |
281232 |
|
|
root@culturestrings |
281232 |
cfg_script="$0"
|
|
root@culturestrings |
281232 |
cfg_srcdir=$(cd -- "${cfg_script%/*}/" ; pwd -P)
|
|
root@culturestrings |
281232 |
|
|
root@culturestrings |
281232 |
sed -e 's/@sitesubd@/'"${sitesubd}"'/g' \
|
|
root@culturestrings |
281232 |
-e 's/@sitezone@/'"${sitezone}"'/g' \
|
|
root@culturestrings |
281232 |
-e 's/@sitepref@/'"${sitepref}"'/g' \
|
|
root@culturestrings |
281232 |
"${cfg_srcdir}/nginx.${sitetype}.conf.in"
|