summaryrefslogtreecommitdiff
path: root/public/fs/etc/nginx/vhosts.d/nginx-subdomain-cfg.sh
blob: 942e28967a9f5ac4a0cac2d8b48925217039c75e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

set -eu

sitetype="$1"
sitesubd="$2"
sitezone="${sitesubd#*.}"
sitepref="${sitesubd%%.*}"

cfg_script="$0"
cfg_srcdir=$(cd -- "${cfg_script%/*}/" ; pwd -P)

sed -e 's/@sitesubd@/'"${sitesubd}"'/g'      \
	-e 's/@sitezone@/'"${sitezone}"'/g'  \
	-e 's/@sitepref@/'"${sitepref}"'/g'  \
	"${cfg_srcdir}/nginx.${sitetype}.conf.in"