-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_pre-reqs.bash
82 lines (77 loc) · 3.27 KB
/
install_pre-reqs.bash
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#! /bin/bash
## This script installs pre-requisites for system-info python modules on Ubuntu's LTS version of OS machines.
## Easy to use script when initializing either of the systems with Vagrant or in isolation.
## Tested on Ubuntu 16.04 xenial & 18.04 bionic
if [ "$(grep -Ei 'ID=ubuntu|VERSION_ID="16.04"' /etc/os-release)" ];
then
echo "OS is Ubuntu." && echo
if [ "$(grep -Ei 'VERSION_ID="16.04"' /etc/os-release)" ];
then
echo "OS Version is 16.04 i.e. Ubuntu 16.04 xenial. Python 3.5.2 is available by default on the system." && echo
echo "Beginning of pre-requistes & installation of pip3 and psutil." && echo
echo "Performing apt-get update" && echo
sudo apt-get update -y
sleep 30
echo
echo "Printing the existing Python3's version." && echo
python3 -V
echo "Installing Python3's PIP and other tools." && echo
sudo apt-get install -y python3-pip build-essential libssl-dev libffi-dev python-dev python3-setuptools
echo "Upgrading pip3 to latest version"
sudo -H pip3 install --upgrade pip
echo "Installing psutil library using pip" && echo
sudo -H pip3 install psutil # Installing psutil
sleep 30
echo
echo "Installation of pre-reqs has been completed!" && echo
elif [ "$(grep -Ei 'VERSION_ID="18.04"' /etc/os-release)" ];
then
echo "OS Version is 18.04 i.e. Ubuntu 18.04 bionic. Python 3.5.2 is available by default on the system." && echo
echo "Beginning of pre-requistes & installation of pip3 and psutil." && echo
echo "Performing apt-get update" && echo
sudo apt-get update -y
sleep 30
echo
echo "Printing the existing Python3's version." && echo
python3 -V
echo "Installing Python3's PIP and other tools." && echo
sudo apt-get install -y python3-pip build-essential libssl-dev libffi-dev python-dev python3-setuptools
echo "Upgrading pip3 to latest version"
sudo -H pip3 install --upgrade pip
echo "Installing psutil library using pip" && echo
sudo -H pip3 install psutil # Installing psutil
sleep 30
echo
echo "Installation of pre-reqs has been completed!" && echo
else
echo "OS is not one of the LTS ubuntu versions."
fi
else
echo "This was scripted for LTS version of Ubuntu OS's. Either the OS/Version is not Ubuntu or a LTS version of OS. Please contact Ali Muhammad (https://github.com/Tech-Overlord) to add the required Ubuntu OS version into the script."
fi
# if [ "$(grep -Ei 'ID="centos"|CENTOS_MANTISBT_PROJECT_VERSION="7"' /etc/os-release)" ];
# then
# echo
# echo "OS is CentOS & Version is 7 i.e. CentOS-7" && echo
# echo "Beginning of pre-requistes & docker installation." && echo
# echo "Performing update." && echo
# sudo sudo yum update -y
# sleep 30
# echo
# echo "Installing yum-utils" && echo
# sudo yum install yum-utils -y
# sleep 5
# echo
# echo "Installing IUS" && echo
# sudo yum install https://centos7.iuscommunity.org/ius-release.rpm -y
# echo "Installing Python3.6 - Latest stable version at the time of this script's development." && echo
# sudo yum install python36u -y
# sleep 30
# echo
# echo "Installing Python 3.6's pip" && echo
# sudo yum install python36u-pip -y
# sleep 10
# echo "Installing psutil library using pip" && echo
# sudo pip3.6 install psutil # Installing psutil
# echo "Installation of pre-reqs has been completed!" && echo
# fi