#!/bin/bash : ${ALIVE_BASE:=/usr/lib/vmware-vcops} KEYTOOL="$ALIVE_BASE/jre/bin/keytool" KEYSTORE="$ALIVE_BASE/user/conf/truststore" ALIAS="Deep_Security_Manager" CERT="/root/TrendMicro/manager.cer" PASS="oxygen" GETCERT= [ -f $KEYSTORE ] || { printf "\nERROR: $KEYSTORE not found" printf "\n or is not a regular file. No certificate will be imported." printf "\n Exiting.\n\n" exit 1 } if [ -f $CERT ] then while true do printf "\n$CERT will be imported into the vC Ops trust store.\n" read -p \ "Do you wish to import a different certificate ? (y/n) " yn case $yn in [Yy]* ) GETCERT=1; break;; [Nn]* ) break;; * ) echo "Please answer yes or no.";; esac done else GETCERT=1 fi [ "$GETCERT" ] && { while true do echo "" read -p \ "Enter the full path to the Deep Security Manager certificate: " CERT if [ -f $CERT ] then break else printf "\n$CERT not found or is not a regular file.\n" fi done } if [ -x $KEYTOOL ] then printf "\nImporting Deep Security Manager certificate $CERT ..." $KEYTOOL -import -noprompt -alias $ALIAS -file $CERT -keystore $KEYSTORE \ -storepass $PASS -trustcacerts printf " done.\n" else printf "\n$KEYTOOL not found or is not executable. No certificate imported." printf "\nExiting.\n\n" exit 1 fi