+#HTTPS Configurations
+sed -i "s|keyStorePath:.*|keyStorePath: $KEY_PATH|" "$main_path/conf/rulemgt.yml"
+sed -i "s|keyStorePassword:.*|keyStorePassword: $KEY_PASSWORD|" "$main_path/conf/rulemgt.yml"
+
+if [ ${ENABLE_ENCRYPT} = true ]; then
+ sed -i "s|type:\s*https\?$|type: https|" "$main_path/conf/rulemgt.yml"
+ sed -i "s|#\?keyStorePath|keyStorePath|" "$main_path/conf/rulemgt.yml"
+ sed -i "s|#\?keyStorePassword|keyStorePassword|" "$main_path/conf/rulemgt.yml"
+ sed -i "s|#\?validateCerts|validateCerts|" "$main_path/conf/rulemgt.yml"
+ sed -i "s|#\?validatePeers|validatePeers|" "$main_path/conf/rulemgt.yml"
+else
+ sed -i 's|type:\s*https\?$|type: http|' "$main_path/conf/rulemgt.yml"
+ sed -i "s|#\?keyStorePath|#keyStorePath|" "$main_path/conf/rulemgt.yml"
+ sed -i "s|#\?keyStorePassword|#keyStorePassword|" "$main_path/conf/rulemgt.yml"
+ sed -i "s|#\?validateCerts|#validateCerts|" "$main_path/conf/rulemgt.yml"
+ sed -i "s|#\?validatePeers|#validatePeers|" "$main_path/conf/rulemgt.yml"
+fi
+
+
+${RUNHOME}/initDB.sh "$JDBC_USERNAME" "$JDBC_PASSWORD" "$DB_NAME" "$DB_PORT" "${URL_JDBC%:*}"
+
+
+if [ -f "/opt/app/osaaf/local/org.onap.holmes-rule-mgmt.crt" ]; then
+ sed -i "s|/etc/ssl/certs/holmes-frontend-selfsigned.crt|/opt/app/osaaf/local/org.onap.holmes-rule-mgmt.crt|" "/etc/nginx/conf.d/nginx-https.conf"
+ sed -i "s|/etc/ssl/private/holmes-frontend.key|/opt/app/osaaf/local/org.onap.holmes-rule-mgmt.key|" "/etc/nginx/conf.d/nginx-https.conf"
+fi
+
+if [ "$MSB_IAG_SERVICE_PORT"x = "443"x ]; then
+ sed -i "s|http://msb-iag.onap|https://$MSB_IAG_SERVICE_HOST:$MSB_IAG_SERVICE_PORT|g" /etc/nginx/conf.d/nginx-http*.conf
+else
+ sed -i "s|http://msb-iag.onap|http://$MSB_IAG_SERVICE_HOST:$MSB_IAG_SERVICE_PORT|g" /etc/nginx/conf.d/nginx-http*.conf
+fi
+
+if [ "${ENABLE_ENCRYPT}"x = "true"x ]; then
+ nginx -c /etc/nginx/conf.d/nginx-https.conf
+else
+ nginx -c /etc/nginx/conf.d/nginx-http.conf
+fi
+echo nginx started.
+
+"$JAVA" $JAVA_OPTS -classpath "$class_path" org.onap.holmes.rulemgt.RuleActiveApp server "$main_path/conf/rulemgt.yml"