-
Notifications
You must be signed in to change notification settings - Fork 65
/
installLAMP.sh
35 lines (26 loc) · 854 Bytes
/
installLAMP.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
#!/bin/bash
clear
echo 'Going to install the LAMP stack on your machine, here we go...'
echo '------------------------'
read -p "MySQL Password: " mysqlPassword
read -p "Retype password: " mysqlPasswordRetype
yum install -y httpd php mysql mysql-server
chkconfig mysql-server on
chkconfig httpd on
/etc/init.d/mysqld restart
while [[ "$mysqlPassword" = "" && "$mysqlPassword" != "$mysqlPasswordRetype" ]]; do
echo -n "Please enter the desired mysql root password: "
stty -echo
read -r mysqlPassword
echo
echo -n "Retype password: "
read -r mysqlPasswordRetype
stty echo
echo
if [ "$mysqlPassword" != "$mysqlPasswordRetype" ]; then
echo "Passwords do not match!"
fi
done
/usr/bin/mysqladmin -u root password $mysqlPassword
clear
echo 'Okay.... apache, php and mysql is installed, running and set to your desired password'