Skip to content

Instantly share code, notes, and snippets.

@thejeff77
Created March 12, 2019 15:13
Show Gist options
  • Save thejeff77/5734410f39e977dc0fa5f7b4830a2110 to your computer and use it in GitHub Desktop.
Save thejeff77/5734410f39e977dc0fa5f7b4830a2110 to your computer and use it in GitHub Desktop.
Script Example For Jmeter Installation on Linux/Mac. Adjust jmeter version & DL URL accordingly
#!/bin/bash
#Mac requires wget to be installed '> brew install wget'
function pause(){
read -p "$*"
}
if [[ "$EUID" -ne 0 ]]; then
echo "This script should not be run using sudo or as the root user"
exit 1
fi
if [ ! -d "~/jmeter/apache-jmeter-4.0/" ]
then
echo "Jmeter not installed!"
echo "Press [Enter] to install jmeter to ~/jmeter..."
pause
wget -O ~/jmeter.temp.tgz http://www-us.apache.org/dist//jmeter/binaries/apache-jmeter-4.0.tgz
mkdir ~/jmeter
tar zxf ~/jmeter.temp.tgz -C ~/jmeter
rm ~/jmeter.temp.tgz
echo "Just installed jmeter!"
cd ~/jmeter/apache-jmeter-4.0/bin
echo "Attempting to add jmeter to your path."
export PATH=~/jmeter/apache-jmeter-4.0/bin:$PATH
echo "PATH=~/jmeter/apache-jmeter-4.0/bin:$PATH" >> ~/.bash_profile
else
echo "Jmeter is already installed, to re-install, delete the ~/jmeter folder and try again"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment