-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10-install-command.sh
More file actions
39 lines (34 loc) · 828 Bytes
/
10-install-command.sh
File metadata and controls
39 lines (34 loc) · 828 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
#!/bin/bash
USERID=$(id -u)
if [ $USERID -ne 0 ]
then
echo "ERROR:: Please run this script with root access"
exit 1 #give other than 0 upto 127
else
echo "You are running with root access"
fi
dnf list installed mysql
# check already installed or not. if Installed $? is 0, then
# If not installed $? is not 0. expression is true
if [ $? -ne 0 ]
then
echo "MySQL is not installed... going to install it"
dnf install mysql -y
if [ $? -eq 0 ]
then
echo "Installing MySQL is ... SUCCESS"
else
echo "Installing MySQL is ... FAILURE"
exit 1
fi
else
echo "MySQL is already installed...Nothing to do"
fi
# dnf install mysql -y
# if [ $? -eq 0 ]
# then
# echo "Installing MySQL is ... SUCCESS"
# else
# echo "Installing MySQL is ... FAILURE"
# exit 1
# fi