|
@@ -1,7 +1,7 @@
|
|
|
#!/bin/bash
|
|
|
export DOLAR='$'
|
|
|
+
|
|
|
for fn in `ls /etc/nginx/conf.d/*.conf.tpl`; do
|
|
|
- echo $fn " -> " ${fn:0:(-4)}
|
|
|
# remove .conf.tpl
|
|
|
fnn=${fn:0:(-9)}
|
|
|
# get the name of file
|
|
@@ -11,18 +11,22 @@ for fn in `ls /etc/nginx/conf.d/*.conf.tpl`; do
|
|
|
# generete string to find
|
|
|
host_name="HOST_${name}="
|
|
|
# greo in host.env
|
|
|
- module=$(set | grep ${host_name})
|
|
|
+ module=$(set | grep ${host_name} | head -1)
|
|
|
# get the url access
|
|
|
value=${module##*=}
|
|
|
# get length
|
|
|
exist=${#value}
|
|
|
if [ "${exist}" != "0" ];
|
|
|
then
|
|
|
+ echo "--------------------------------------------------------------------------------------"
|
|
|
+ echo "Config file -> " ${fn:0:(-4)}
|
|
|
# module is installed
|
|
|
envsubst < $fn > ${fn:0:(-4)}
|
|
|
- cat ${fn:0:(-4)}
|
|
|
+ cat ${fn:0:(-4)}
|
|
|
+ else
|
|
|
+ echo "--------------------------------------------------------------------------------------"
|
|
|
+ echo "VARIABLE IS NOT DEFINED IN FILE host.env -> $fn"
|
|
|
fi
|
|
|
done
|
|
|
|
|
|
-
|
|
|
nginx -g "daemon off;"
|