forked from lerndevops/labs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstallGit.sh
More file actions
executable file
·37 lines (29 loc) · 897 Bytes
/
Copy pathinstallGit.sh
File metadata and controls
executable file
·37 lines (29 loc) · 897 Bytes
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
#!/bin/bash
if [ -f /etc/os-release ];then
osname=`grep ID /etc/os-release | egrep -v 'VERSION|LIKE|VARIANT' | cut -d'=' -f2 | sed -e 's/"//' -e 's/"//'`
echo $osname
else
echo "can not locate /etc/os-release - unable find the osname"
exit 8
fi
if [ $osname == "ubuntu" ];then
clear
sudo apt-get install -y software-properties-common
sudo apt-add-repository --yes --update ppa:git-core/ppa
sudo apt-get update
sudo apt-get install -y git
echo "`git --version | head -1` installed Successfully"
elif [ $osname == "amzn" ]; then
clear
sudo yum install -y epel-release
sudo yum update
sudo yum install -y git
echo "`git --version | head -1` installed Successfully"
elif [ $osname == "centos" ];then
clear
sudo yum install -y epel-release
sudo yum update
sudo yum install -y git
echo "`git --version | head -1` installed Successfully"
fi
exit 0