X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=engine-d-standalone%2Fsrc%2Fmain%2Fassembly%2Fbin%2Frun.sh;h=d036cebcac79202012a3ae80fd0037d185cd0d76;hb=3f438510b3aae2372b33d4d976cd10482a07492a;hp=f682ed7b02c22c771f8874cda493fc7b6caff664;hpb=94366b596c4c45427b1b9641609f98155e68d60c;p=holmes%2Fengine-management.git diff --git a/engine-d-standalone/src/main/assembly/bin/run.sh b/engine-d-standalone/src/main/assembly/bin/run.sh index f682ed7..d036ceb 100644 --- a/engine-d-standalone/src/main/assembly/bin/run.sh +++ b/engine-d-standalone/src/main/assembly/bin/run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Copyright 2017 ZTE Corporation. @@ -33,10 +33,6 @@ echo @JAVA_OPTS@ $JAVA_OPTS class_path="$main_path/:$main_path/holmes-engine-d.jar" echo @class_path@ $class_path -sed -i "s/activemq.username=.*/activemq.username=activemq/" /home/activemq/apache-activemq-5.9.0/conf/credentials.properties -sed -i "s/activemq.password=.*/activemq.password=v1/" /home/activemq/apache-activemq-5.9.0/conf/credentials.properties -/home/activemq/apache-activemq-5.9.0/bin/activemq start - if [ -z ${JDBC_USERNAME} ]; then export JDBC_USERNAME=holmes echo "No user name is specified for the database. Use the default value \"$JDBC_USERNAME\"." @@ -67,18 +63,40 @@ if [ ! -z ${TESTING} ] && [ ${TESTING} == 1 ]; then fi fi -#ActiveMQ IP Configurations -sed -i "s|brokerIp:.*|brokerIp: $SERVICE_IP|" "$main_path/conf/engine-d.yml" +export DB_PORT=5432 +if [ ! -z ${URL_JDBC} ] && [ `expr index $URL_JDBC :` != 0 ]; then + export DB_PORT="${URL_JDBC##*:}" +fi +echo DB_PORT=$DB_PORT -KEY_PATH="$main_path/conf/holmes.keystore" -KEY_PASSWORD="holmes" +if [ -z ${ENABLE_ENCRYPT} ]; then + export ENABLE_ENCRYPT=true +fi +echo ENABLE_ENCRYPT=$ENABLE_ENCRYPT +KEY_PATH="/home/holmes/conf/holmes.keystore" +KEY_PASSWORD="holmes" #HTTPS Configurations sed -i "s|keyStorePath:.*|keyStorePath: $KEY_PATH|" "$main_path/conf/engine-d.yml" sed -i "s|keyStorePassword:.*|keyStorePassword: $KEY_PASSWORD|" "$main_path/conf/engine-d.yml" +if [ ${ENABLE_ENCRYPT} == true ]; then + sed -i "s|type:\s*https\?$|type: https|" "$main_path/conf/engine-d.yml" + sed -i "s|#\?keyStorePath|keyStorePath|" "$main_path/conf/engine-d.yml" + sed -i "s|#\?keyStorePassword|keyStorePassword|" "$main_path/conf/engine-d.yml" + sed -i "s|#\?validateCerts|validateCerts|" "$main_path/conf/engine-d.yml" + sed -i "s|#\?validatePeers|validatePeers|" "$main_path/conf/engine-d.yml" +else + sed -i 's|type:\s*https\?$|type: http|' "$main_path/conf/engine-d.yml" + sed -i "s|#\?keyStorePath|#keyStorePath|" "$main_path/conf/engine-d.yml" + sed -i "s|#\?keyStorePassword|#keyStorePassword|" "$main_path/conf/engine-d.yml" + sed -i "s|#\?validateCerts|#validateCerts|" "$main_path/conf/engine-d.yml" + sed -i "s|#\?validatePeers|#validatePeers|" "$main_path/conf/engine-d.yml" +fi + cat "$main_path/conf/engine-d.yml" +./bin/initDB.sh $JDBC_USERNAME $JDBC_PASSWORD $DB_NAME $DB_PORT "${URL_JDBC%:*}" "$JAVA" $JAVA_OPTS -classpath "$class_path" org.onap.holmes.engine.EngineDActiveApp server "$main_path/conf/engine-d.yml"