summaryrefslogtreecommitdiffstats
path: root/src/main/scripts/VESrestfulCollector.sh
diff options
context:
space:
mode:
authorVENKATESH KUMAR <vv770d@att.com>2018-02-14 17:45:04 +0000
committerVENKATESH KUMAR <vv770d@att.com>2018-02-14 12:50:13 -0500
commit4d3624549f41aeda68b8626270fc491ea99e5ee0 (patch)
treeb7d931e1dc29a183b0f9b3496bdefe6f299ef74e /src/main/scripts/VESrestfulCollector.sh
parent2dfdd151440cd80dc25c928f283df7bcd71cd195 (diff)
Fix keystore alais config and TC
Change-Id: I8e0349f411dc05625b14536afc0acb1fac9a55c2 Signed-off-by: VENKATESH KUMAR <vv770d@att.com> Issue-ID: DCAEGEN2-227
Diffstat (limited to 'src/main/scripts/VESrestfulCollector.sh')
-rw-r--r--src/main/scripts/VESrestfulCollector.sh23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/main/scripts/VESrestfulCollector.sh b/src/main/scripts/VESrestfulCollector.sh
index 45bdc6ef..14e90cc9 100644
--- a/src/main/scripts/VESrestfulCollector.sh
+++ b/src/main/scripts/VESrestfulCollector.sh
@@ -4,7 +4,7 @@
# ============LICENSE_START=======================================================
# PROJECT
# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2018 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.
@@ -28,7 +28,6 @@ usage() {
}
-#BASEDIR=/opt/app/d1gfp1m7/extra/VES/VESCollector-1.1.4-SNAPSHOT/
BASEDIR=/opt/app/VESCollector/
collector_start() {
@@ -108,6 +107,26 @@ collector_configupdate() {
else
echo "INFO: Dynamic config updated successfully into VESCollector configuration!"
fi
+
+ # Identify alias names from keystore and password provided
+
+ paramName="collector.keystore.alias"
+ localpropertyfile="/opt/app/VESCollector/etc/collector.properties"
+ tmpfile="/opt/app/VESCollector/etc/collector.properties.tmp"
+
+ keystore=`grep collector.keystore.file.location $localpropertyfile | tr -d '[:space:]' | cut -d"=" -f2`
+ keypwdfile=`grep collector.keystore.passwordfile $localpropertyfile | tr -d '[:space:]' | cut -d"=" -f2`
+
+ echo "/usr/bin/keytool -list -keystore $keystore < $keypwdfile | grep "PrivateKeyEntry" | cut -d"," -f1"
+ tmpalias=`/usr/bin/keytool -list -keystore $keystore < $keypwdfile | grep "PrivateKeyEntry" | cut -d"," -f1`
+ echo "tmpalias:" $tmpalias
+ alias=`echo $tmpalias | cut -d":" -f2`
+ echo "alias:" $alias
+ sed "s~$paramName=.*~$paramName=$alias~g" $localpropertyfile > $tmpfile
+ echo `cat $tmpfile > $localpropertyfile`
+ rm $tmpfile
+ echo "INFO: Keystore alias updated into configuration"
+
else
echo "ERROR: Configuration file /opt/app/KV-Configuration.json missing"
fi