optionally source .conf files 15/94315/1
authorjhh <jorge.hernandez-herrero@att.com>
Tue, 27 Aug 2019 00:42:15 +0000 (19:42 -0500)
committerjhh <jorge.hernandez-herrero@att.com>
Tue, 27 Aug 2019 00:42:15 +0000 (19:42 -0500)
.conf files are now optional as environment
variables can be used instead without needing
a .conf.

Issue-ID: POLICY-1371
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I2cec20fe40d3bfd020e40c9925760de022d4ef34

packages/base/src/files/etc/profile.d/env.sh

index 00f61df..b692093 100644 (file)
@@ -35,16 +35,15 @@ if [[ -z "${POLICY_HOME}" ]]; then
     fi
 fi
 
-confs=$(ls "${POLICY_HOME}"/etc/profile.d/*.conf 2> /dev/null)
-c=
-
 set -a
 
 POLICY_HOME=${POLICY_HOME:=/opt/app/policy}
 
-for c in ${confs} ; do
-    source ${c}
-done
+if ls "${POLICY_HOME}"/etc/profile.d/*.conf > /dev/null 2>&1; then
+    for conf in "${POLICY_HOME}"/etc/profile.d/*.conf ; do
+        source ${conf}
+    done
+fi
 
 for x in "${POLICY_HOME}"/bin "${JAVA_HOME}"/bin "${HOME}"/bin ; do
   if [ -d $x ] ; then