-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.sh
executable file
·128 lines (59 loc) · 1.97 KB
/
setup.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
RED='\033[0;31m'
BLUE='\033[40;38;5;82m'
PURPLE='\033[0;35m'
echo "
+-+-+-+-+-+-+-+-+-+-+-+
|D|e|v|O|p|s|-|p|a|c|k|
+-+-+-+-+-+-+-+-+-+-+-+
"
checkOS () {
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
*) machine="UNKNOWN:${unameOut}"
esac
}
checkOS
if [ ! -x "$(command -v vagrant)" ]; then
if [ "$machine" == "Mac" ]; then
echo -e "${PURPLE} Installing Vagrant..."
sleep 1
brew cask install vagrant
echo -e " ${PURPLE} Vagrant has been installed!"
elif [ "$machine" == "Linux" ]; then
echo -e "${PURPLE} Installing Vagrant... \e[0m "
sleep 1
sudo apt-get update -y
sudo apt-get install vagrant -y
echo -e " ${PURPLE} Vagrant has been installed! \e[0m "
else
echo -e " ${PURPLE} Vagrant has been installed already!"
fi
fi
if [ ! -x "$(command -v virtualbox)" ];
then
if [ "$machine" == "Mac" ]; then
echo -e "${PURPLE} Installing VirtualBox..."
sleep 1
brew cask install virtualbox
echo -e " ${PURPLE} Virtualbox has been installed!"
elif [ "$machine" == "Linux" ]; then
echo -e "${PURPLE} Installing VirtualBox... \e[0m"
sleep 1
sudo apt-get update -y
sudo apt-get install virtualbox -y
echo -e " ${PURPLE} Virtualbox has been installed! \e[0m "
else
echo -e " ${PURPLE} Vagrant has been installed already!"
fi
fi
if [ -x "$(command -v vagrant)" ] && [ -x "$(command -v virtualbox)" ]; then
if [ "$machine" == "Mac" ]; then
echo -e " ${BLUE} Your machine has meet the requirements to install DevOps-pack. Run *bash devpack.sh* "
elif [ "$machine" == "Linux" ];
then
echo -e " ${BLUE} Your machine has meet the requirements to install DevOps-pack. Run *bash devpack.sh* \e[0m "
fi
fi