-
Notifications
You must be signed in to change notification settings - Fork 0
/
LAMP.sh
executable file
·39 lines (33 loc) · 853 Bytes
/
LAMP.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
36
37
38
39
#!/bin/bash
# This bash script is intended to start and stop the apache2 and mysql servers.
# The reason of this script is to remove any memory overhead when apache2 and mysql is not in use.
function start()
{
#starting apache2
echo '';
echo 'start apache2';
sudo systemctl start apache2
echo 'apache2 started, checking its status: ';
systemctl status apache2
#starting mysql
echo '';
echo 'start mysql';
sudo systemctl start mysql.service
echo 'mysql started, cheking its statsus: ';
systemctl status mysql.service
}
function stop()
{
#stoping apache2
echo '';
echo 'stop apache2';
sudo systemctl stop apache2
echo 'apache2 stopped, checking its status: ';
sudo systemctl status apache2
#stoping mysql
echo '';
echo 'stop mysql';
sudo systemctl stop mysql.service
echo 'mysql stoped, cheking its statsus: ';
sudo systemctl status mysql.service
}