#!/bin/sh tempDir=/tmp/CvTempOpenSSL freewareDir=$1 cvBaseDir=$2 output=0 HelpLog() { echo "Syntax: CvReIndexOpenSSL.sh " echo "Example: ./CvReIndexOpenSSL.sh /opt/freeware /opt/CommVault/Base" } Exec() { echo "$1" echo "`$1`" } if [ -z "$freewareDir" ]; then echo "PgSQL Installation Directory is empty." HelpLog return else if [ -z "$cvBaseDir" ]; then cvBaseDir="`pwd`" fi fi Exec "mkdir -p $tempDir" cd $tempDir Exec "cp "/usr/lib/libcrypto.a" $tempDir"/libcrypto.a.sys"" Exec "cp "/usr/lib/libssl.a" $tempDir"/libssl.a.sys"" Exec "cp $freewareDir"/lib/libcrypto.a" $tempDir"/libcrypto.a"" Exec "cp $freewareDir"/lib/libssl.a" $tempDir"/libssl.a"" Exec "ar -x -X any $tempDir"/libcrypto.a.sys"" Exec "ar -x -X any $tempDir"/libssl.a.sys"" # Add libcrypto64.so.* listOfFile=`ls -1 | grep -i "libcrypto64.so."` for tempFile in $listOfFile do fullPath=$tempDir"/"$tempFile Exec "ar -r -X 64 $tempDir"/libcrypto.a" $fullPath" done # Add libssl64.so.* listOfFile=`ls -1 | grep -i "libssl64.so."` for tempFile in $listOfFile do fullPath=$tempDir"/"$tempFile Exec "ar -r -X 64 $tempDir"/libssl.a" $fullPath" done Exec "cp $tempDir"/libcrypto.a" $cvBaseDir" Exec "cp $tempDir"/libssl.a" $cvBaseDir"