#!/usr/bin/env bash # Copyright 2022 NaveenKumar Namachivayam - QAInsights.com # # 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. # This script is for removing the older version of Apache Commons Text 1.9 and replaces it # with the newer version (1.10.0) in `JMETER_HOME/lib` folder JMETER_VERSION=5.5 JMETER_HOME=/home/$USER/apache-jmeter-${JMETER_VERSION} COMMONS_TEXT_VERSION=1.10.0 COMMONS_TEXT_VERSION_OLD_VERSION=1.9 # Download Apache Commons Text 1.10.0 wget https://dlcdn.apache.org//commons/text/binaries/commons-text-${COMMONS_TEXT_VERSION}-bin.tar.gz # Check Sum expected_checksum512=`curl https://archive.apache.org/dist/commons/text/binaries/commons-text-${COMMONS_TEXT_VERSION}-bin.tar.gz.sha512` actual_checksum512=`sha512sum commons-text-${COMMONS_TEXT_VERSION}-bin.tar.gz | awk '{print $1}'` if [[ "${expected_checksum512}" == "${actual_checksum512}" ]]; then tar -xf commons-text-${COMMONS_TEXT_VERSION}-bin.tar.gz echo "Moving Commons Text ${COMMONS_TEXT_VERSION} to ${JMETER_HOME}/lib" mv commons-text-${COMMONS_TEXT_VERSION}/commons-text-${COMMONS_TEXT_VERSION}.jar $JMETER_HOME/lib # Removing older version of Apache Commons Text from JMeter rm ${JMETER_HOME}/lib/commons-text-${COMMONS_TEXT_VERSION_OLD_VERSION}.jar &> /dev/null # Deleting the downloaded tar file rm commons-text-${COMMONS_TEXT_VERSION}-bin.tar.gz rm -rf commons-text-${COMMONS_TEXT_VERSION} echo "Done." else echo "Checksum mismatch. Exiting." fi