-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathlabauto
More file actions
41 lines (35 loc) · 982 Bytes
/
labauto
File metadata and controls
41 lines (35 loc) · 982 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
38
39
40
41
#!/bin/bash
## Supported OS's
EL=$(rpm -q basesystem | sed -e 's/\./ /g' |xargs -n1 | grep el)
case $EL in
el8|el9) : ;;
*) error "Currently this setup works only for CentOS-8/RHEL-9 OS"
exit 1
;;
esac
if [ "$1" == "clean" ]; then
cd /tmp
rm -rf labautomation
echo -e "\e[1;35m Cleanup Succeeded\e[0m"
exit 0
else
if [ -d /tmp/labautomation ]; then
cd /tmp/labautomation
git pull &>/dev/null
if [ $? -ne 0 ]; then
cd /tmp
rm -rf /tmp/lab*
git clone https://github.com/learndevopsonline/labautomation.git /tmp/labautomation &>/dev/null
fi
else
git clone https://github.com/learndevopsonline/labautomation.git /tmp/labautomation &>/dev/null
fi
fi
if [ ! -f /tmp/labautomation/setup.sh ]; then
echo -e "\e[1;33m💡💡 Hint! Try Using \e[0m\e[1m'sudo labauto clean'\e[0m"
exit 1
fi
source /tmp/labautomation/dry/common-functions.sh
## Checking Root User or not.
CheckRoot
bash /tmp/labautomation/setup.sh $*