|
@@ -2,8 +2,26 @@
|
|
|
export DOLAR='$'
|
|
|
for fn in `ls /etc/nginx/conf.d/*.conf.tpl`; do
|
|
|
echo $fn " -> " ${fn:0:(-4)}
|
|
|
- envsubst < $fn > ${fn:0:(-4)}
|
|
|
- cat ${fn:0:(-4)}
|
|
|
+ # remove .conf.tpl
|
|
|
+ fnn=${fn:0:(-9)}
|
|
|
+ # get the name of file
|
|
|
+ name=${fnn##*/}
|
|
|
+ # apply uppercase
|
|
|
+ name=${name^^}
|
|
|
+ # generete string to find
|
|
|
+ host_name="HOST_${name}="
|
|
|
+ # greo in host.env
|
|
|
+ module=$(set | grep ${host_name})
|
|
|
+ # get the url access
|
|
|
+ value=${module##*=}
|
|
|
+ # get length
|
|
|
+ exist=${#value}
|
|
|
+ if [ "${exist}" != "0" ];
|
|
|
+ then
|
|
|
+ # module is installed
|
|
|
+ envsubst < $fn > ${fn:0:(-4)}
|
|
|
+ cat ${fn:0:(-4)}
|
|
|
+ fi
|
|
|
done
|
|
|
|
|
|
|