Prechádzať zdrojové kódy

Only services that are defined in the host.env file are configured

Gabriel 6 rokov pred
rodič
commit
f7b1ea0d96
1 zmenil súbory, kde vykonal 8 pridanie a 4 odobranie
  1. 8 4
      nginx-config.sh

+ 8 - 4
nginx-config.sh

@@ -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;"