summaryrefslogtreecommitdiffstats
path: root/aai-resources/src/main/scripts/common_functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'aai-resources/src/main/scripts/common_functions.sh')
-rw-r--r--aai-resources/src/main/scripts/common_functions.sh23
1 files changed, 13 insertions, 10 deletions
diff --git a/aai-resources/src/main/scripts/common_functions.sh b/aai-resources/src/main/scripts/common_functions.sh
index e99746d..14358d9 100644
--- a/aai-resources/src/main/scripts/common_functions.sh
+++ b/aai-resources/src/main/scripts/common_functions.sh
@@ -60,16 +60,19 @@ execute_spring_jar(){
JAVA_OPTS="$JAVA_OPTS -Dlogback.configurationFile=${logbackFile}";
export SOURCE_NAME=$(grep '^schema.source.name=' ${PROJECT_HOME}/resources/application.properties | cut -d"=" -f2-);
- # Needed for the schema ingest library beans
- eval $(grep '^schema\.' ${PROJECT_HOME}/resources/application.properties | \
- sed 's/^\(.*\)$/JAVA_OPTS="$JAVA_OPTS -D\1"/g' | \
- sed 's/${server.local.startpath}/${PROJECT_HOME}\/resources/g'| \
- sed 's/${schema.source.name}/'${SOURCE_NAME}'/g'\
- )
-
- JAVA_OPTS="${JAVA_OPTS} ${JAVA_POST_OPTS}";
-
- ${JAVA_HOME}/bin/java ${JVM_OPTS} ${JAVA_OPTS} -jar ${EXECUTABLE_JAR} "$@"
+ # Needed for the schema ingest library beans
+ eval $(egrep '^(schema|server)\.' ${PROJECT_HOME}/resources/application.properties | \
+ sed 's/^\(.*\)$/JAVA_OPTS="$JAVA_OPTS -D\1"/g' | \
+ sed 's/${server.local.startpath}/${PROJECT_HOME}\/resources/g'| \
+ sed 's/${schema.source.name}/'${SOURCE_NAME}'/g'\
+ )
+
+ JAVA_OPTS="${JAVA_OPTS} ${JAVA_POST_OPTS}";
+
+ "${JAVA_HOME}/bin/java" ${JVM_OPTS} ${JAVA_OPTS} -jar ${EXECUTABLE_JAR} "$@" || {
+ echo "Failed to run the tool $0 successfully";
+ exit 1;
+ }
}
# Prints the start date and the script that the user called