Missing Licenses
[aaf/authz.git] / auth / sample / bin / client.sh
index 363e2b4..b69646d 100755 (executable)
@@ -1,4 +1,23 @@
 #!/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 client Container.
 #  It needs to cover the cases where the initial data doesn't exist, and when it has already been configured (don't overwrite)
 #
@@ -66,6 +85,8 @@ if [ ! -e "$DOT_AAF/keyfile" ]; then
     base64 -d $CONFIG/cert/truststoreONAPall.jks.b64 > $DOT_AAF/truststoreONAPall.jks
     echo "cadi_truststore=$DOT_AAF/truststoreONAPall.jks" >> ${SSO}
     echo cadi_truststore_password=enc:$(sso_encrypt changeit) >> ${SSO}
+    echo "Caller Properties Initialized"
+    INITIALIZED="true"
 fi
 
 # Only initialize once, automatically...
@@ -92,6 +113,8 @@ if [ ! -e $LOCAL/${NS}.props ]; then
     
         echo "#### Validate Configuration and Certificate with live call"
         $JAVA_AGENT_SELF validate 
+        echo "Obtained Certificates"
+        INITIALIZED="true"
     else
        echo "#### Certificate Authorization Artifact must be valid to continue"
     fi
@@ -101,7 +124,11 @@ fi
 # Now run a command
 CMD=$2
 if [ -z "$CMD" ]; then
-    $JAVA_AGENT 
+    if [ -n "$INITIALIZED" ]; then
+      echo "Initialization complete"
+    else
+      $JAVA_AGENT
+    fi
 else 
     shift
     shift