#!/bin/bash
+#########
+# ============LICENSE_START====================================================
+# org.onap.aaf
+# ===========================================================================
+# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+# ===========================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END====================================================
+#
# This script is run when starting aaf_config Container.
# It needs to cover the cases where the initial data doesn't exist, and when it has already been configured (don't overwrite)
#
if [ ! -e $FILE ]; then
mkdir -p $DATA
cp $CONFIG/data/sample.identities.dat $FILE
+ echo "Set Identities"
+ INITIALIZED="true"
fi
# Load up Cert/X509 Artifacts
mkdir -p $PUBLIC
if [ -e $CONFIG/cert/org.osaaf.aaf.signer.p12 ]; then
cp $CONFIG/cert/org.osaaf.aaf.signer.p12 $FILE
+ echo "Installed Signer P12"
+ INITIALIZED="true"
else
echo "Decode"
base64 -d $CONFIG/cert/demoONAPsigner.p12.b64 > $FILE
cp $CONFIG/cert/AAF_RootCA.cer $PUBLIC
CM_TRUST_CAS="$PUBLIC/AAF_RootCA.cer"
echo "cadi_keystore_password=something easy" >> $CONFIG/local/aaf.props
+ echo "Setup ONAP Test CAs and Signers"
+ INITIALIZED="true"
fi
fi
if [ ! -e $FILE ]; then
if [ -e $CONFIG/cert/org.osaaf.aaf.p12 ]; then
cp $CONFIG/cert/org.osaaf.aaf.p12 $FILE
+ echo "Installed AAF P12"
+ INITIALIZED="true"
else
echo "Bootstrap Creation of Keystore from Signer"
cd $CONFIG/CA
CM_CA_PASS="something easy"
CM_CA_LOCAL="org.onap.aaf.auth.cm.ca.LocalCA,$LOCAL/org.osaaf.aaf.signer.p12;aaf_intermediate_9;enc:"
CM_TRUST_CAS="$PUBLIC/AAF_RootCA.cer"
+ echo "Generated ONAP Test AAF certs"
+ INITIALIZED="true"
fi
fi
echo "cm_ca.local=$CM_CA_LOCAL" >> $FILE
echo "cm_trust_cas=$CM_TRUST_CAS" >> $FILE
fi
+ echo "Created AAF Initial Configurations"
+ INITIALIZED="true"
fi
# Now run a command
CMD=$2
if [ -z "$CMD" ]; then
- $JAVA_AGENT
+ if [ -n "$INITIALIZED" ]; then
+ echo "Initialization Complete"
+ else
+ echo "No Additional Initialization required"
+ fi
else
shift
shift
$JAVA_AAFCLI perm list user aaf@aaf.osaaf.org
;;
onap)
- echo Initializing ONAP configurations.
+ #echo Initializing ONAP configurations.
;;
bash)
shift
taillog)
sh /opt/app/osaaf/logs/taillog
;;
+ wait)
+ bash $CONFIG/bin/pod_wait.sh wait $1
+ ;;
--help | -?)
case "$1" in
"")