From 8f8a41dc02eb7f2c4c1e607fc3cb97f2c04c42e0 Mon Sep 17 00:00:00 2001 From: jhh Date: Mon, 26 Aug 2019 19:42:15 -0500 Subject: optionally source .conf files .conf files are now optional as environment variables can be used instead without needing a .conf. Issue-ID: POLICY-1371 Signed-off-by: jhh Change-Id: I2cec20fe40d3bfd020e40c9925760de022d4ef34 --- packages/base/src/files/etc/profile.d/env.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'packages/base/src/files') diff --git a/packages/base/src/files/etc/profile.d/env.sh b/packages/base/src/files/etc/profile.d/env.sh index 00f61df4..b6920935 100644 --- a/packages/base/src/files/etc/profile.d/env.sh +++ b/packages/base/src/files/etc/profile.d/env.sh @@ -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 -- cgit 1.2.3-korg