3 # Common functions that can be used throughout multiple scripts
4 # In order to call these functions, this file needs to be sourced
6 # Checks if the user that is currently running is aaiadmin
9 userid=$( id | cut -f2 -d"(" | cut -f1 -d")" )
11 if [ "${userid}" != "aaiadmin" ]; then
12 echo "You must be aaiadmin to run $0. The id used $userid."
17 # Sources the profile and sets the project home
19 . /etc/profile.d/aai.sh
20 PROJECT_HOME=/opt/app/aai-traversal
23 # Runs the spring boot jar based on which main class
24 # to execute and which logback file to use for that class
32 EXECUTABLE_JAR=$(ls ${PROJECT_HOME}/lib/aai-traversal-*SNAPSHOT.jar);
34 JAVA_OPTS="${JAVA_PRE_OPTS}";
35 JAVA_OPTS="-DAJSC_HOME=$PROJECT_HOME";
36 JAVA_OPTS="$JAVA_OPTS -DBUNDLECONFIG_DIR=resources";
37 JAVA_OPTS="$JAVA_OPTS -Daai.home=$PROJECT_HOME ";
38 JAVA_OPTS="$JAVA_OPTS -Dhttps.protocols=TLSv1.1,TLSv1.2";
39 JAVA_OPTS="$JAVA_OPTS -Dloader.main=${className}";
40 JAVA_OPTS="$JAVA_OPTS -Dlogback.configurationFile=${logbackFile}";
41 JAVA_OPTS="${JAVA_OPTS} ${JAVA_POST_OPTS}";
43 ${JAVA_HOME}/bin/java ${JVM_OPTS} ${JAVA_OPTS} -jar ${EXECUTABLE_JAR} "$@"
46 # Prints the start date and the script that the user called
49 echo `date` " Starting $0"
52 # Prints the end date and the script that the user called
55 echo `date` " Done $0"