X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fbin%2Fstart.sh;h=ced887aff005c71acb3ac25c605bc3540b6c474b;hb=f518411876d6830d83d051a915f0b21bdfdcb43e;hp=fecadcccfb7fe493a6baaa1e27100d3bcfc30c24;hpb=5da95c0df892b635db68550a3321e0e48c9e78f8;p=aai%2Fdata-router.git diff --git a/src/main/bin/start.sh b/src/main/bin/start.sh index fecadcc..ced887a 100644 --- a/src/main/bin/start.sh +++ b/src/main/bin/start.sh @@ -9,7 +9,27 @@ if [ -z "$CONFIG_HOME" ]; then exit 1 fi +if [ -z "$KEY_STORE_PASSWORD" ]; then + echo "KEY_STORE_PASSWORD must be set in order to start up process" + exit 1 +else + ## Extract java jar to DEOBFUSCATE the password. + CURR_D=`pwd` + cd $BASEDIR + jar xf data-router.jar + sudo java -cp ./BOOT-INF/lib/jetty-util-9.4.8.v20171121.jar org.eclipse.jetty.util.security.Password $KEY_STORE_PASSWORD > pass.txt 2>> pass.txt + PASS=`sed "2q;d" pass.txt` + sudo rm pass.txt + cd $CURR_D +fi + +## tomcat_keystore to p12 +keytool -importkeystore -noprompt -deststorepass $PASS -destkeypass $PASS -srckeystore $BASEDIR/config/auth/tomcat_keystore -destkeystore $BASEDIR/config/auth/onap.p12 -deststoretype PKCS12 -srcstorepass $PASS + +## import into cacerts +sudo keytool -importkeystore -noprompt -deststorepass changeit -destkeypass changeit -destkeystore /$JAVA_HOME/jre/lib/security/cacerts -srckeystore $BASEDIR/config/auth/onap.p12 -srcstoretype PKCS12 -srcstorepass $PASS -alias tomcat +PROPS="-DBASEDIR=$BASEDIR" PROPS="-DAJSC_HOME=$AJSC_HOME" PROPS="$PROPS -DAJSC_CONF_HOME=$AJSC_CONF_HOME" PROPS="$PROPS -Dlogging.config=$BASEDIR/bundleconfig/etc/logback.xml"