forked from Nettas/f5xc-aws-ce-natgtwy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_prep.sh
executable file
·39 lines (34 loc) · 979 Bytes
/
example_prep.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
!/usr/bin/env bash
#Need to check OS / Platform
osName=`uname -s`
case $osName in
Linux*) export machine="Linux" ;;
Darwin*) export machine="Mac" ;;
*) export machine="UNKNOWN:$osName" ;;
esac
echo $machine
if [[ "$machine" == "Mac" ]]; then
echo "OSX Detected, need to Install / Update Brew and jq..."
#Need to update brew and make sure jq is installed to process json
echo "updating & upgrading brew..."
brew update || brew update
brew upgrade
if brew ls --versions jq > /dev/null; then
# The package is installed
echo "jq installed proceeding..."
else
echo "installing jq..."
brew install jq
fi
elif [[ "$machine" == "Linux" ]]; then
if [ -f /etc/redhat-release ]; then
yum -y update
yum -y install jq
fi
if [ -f /etc/lsb-release ]; then
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install jq curl
fi
fi
export VOLT_API_P12_FILE=/creds/.api-creds.p12
export VES_P12_PASSWORD=12345678