diff options
author | Jorge Hernandez <jh1730@att.com> | 2017-08-28 18:25:23 -0500 |
---|---|---|
committer | Jorge Hernandez <jh1730@att.com> | 2017-08-28 20:21:30 -0500 |
commit | 0c07ac46409b1b55f8bf949f50354e8c00e6122f (patch) | |
tree | d129e3f385eac5d649650629fac4f63189616dea /policy-drools/docker-install.sh | |
parent | 491f6722e91c59f61939c99f03294baa41cf7d60 (diff) |
policy executable renaming + minor install changes
Issue-ID: POLICY-162
Change-Id: Iccbe9d8995be3f828e780a724dae1199c8aeb7c6
Signed-off-by: Jorge Hernandez <jh1730@att.com>
Diffstat (limited to 'policy-drools/docker-install.sh')
-rw-r--r-- | policy-drools/docker-install.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/policy-drools/docker-install.sh b/policy-drools/docker-install.sh index 8f5fbe4e..40a12649 100644 --- a/policy-drools/docker-install.sh +++ b/policy-drools/docker-install.sh @@ -157,11 +157,11 @@ function configure_component() { SED_LINE+=" -e 's!\${{JAVA_HOME}}!${JAVA_HOME}!g' " while read line || [ -n "${line}" ]; do - if [[ -n ${line} ]] && [[ ${line:0:1} != \# ]]; then - name=$(echo "${line%%=*}") - value=$(echo "${line#*=}") - # escape ampersand so that sed does not replace it with the search string - value=$(echo "${value}" | sed -e 's/[\/&]/\\&/g') + if [[ -n ${line} ]] && [[ ${line:0:1} != \# ]]; then + name=$(echo "${line%%=*}") + value=$(echo "${line#*=}") + # escape ampersand so that sed does not replace it with the search string + value=$(echo "${value}" | sed -e 's/[\/&]/\\&/g') if [[ -z ${name} ]] || [[ -z ${value} ]]; then echo "WARNING: ${line} missing name or value" fi @@ -170,14 +170,14 @@ function configure_component() { done < "$CONF_FILE" SED_FILES="" - for sed_file in $(find "${COMPONENT_ROOT_DIR}" -path ${COMPONENT_ROOT_DIR}/backup -prune -o -name '*.xml' -o -name '*.sh' -o -name '*.properties' -o -name '*.json' -o -name '*.conf' -o -name '*.cfg' -o -name '*.template' -o -name '*.conf' -o -name '*.cron'); do + for sed_file in $(find "${COMPONENT_ROOT_DIR}" -type f -exec grep -Iq . {} \; -print 2> /dev/null); do if fgrep -l '${{' ${sed_file} > /dev/null 2>&1; then SED_FILES+="${sed_file} " fi done if [[ -z ${SED_FILES} ]]; then - echo "WARNING: no xml, sh, properties, or conf files to perform configuration expansion" + echo "WARNING: no files to perform variable expansion" else SED_LINE+=${SED_FILES} eval "${SED_LINE}" @@ -402,14 +402,14 @@ function install_base() { exit 1 fi - BASEX_TGZ=$(ls basex-*.tar.gz) - if [ ! -r ${BASEX_TGZ} ]; then - echo "warning: basex package is not accessible" + BASEX_TGZ=$(ls basex-*.tar.gz 2> /dev/null) + if [ -z ${BASEX_TGZ} ]; then + echo "warning: no basex application package present" BASEX_TGZ= else tar -tzf ${BASEX_TGZ} > /dev/null 2>&1 if [[ $? != 0 ]]; then - echo >&2 "warning: invalid basex package tar file: ${BASEX_TGZ}" + echo >&2 "warning: invalid basex application package tar file: ${BASEX_TGZ}" BASEX_TGZ= fi fi |