-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathlemp
42 lines (40 loc) · 767 Bytes
/
lemp
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
42
#!/bin/bash
if ! [ $# -eq 1 ]
then
echo "Usage: `basename $0` [start|restart|stop|status]"
exit 1
fi
case "$1" in
start)
echo "Starting Nginx..."
sudo service nginx start
sleep 1
echo "Starting PHP7..."
sudo service php7.2-fpm start
sleep 1
;;
stop)
echo "Stopping Nginx..."
sudo service nginx stop
sleep 1
echo "Stopping PHP7..."
sudo service php7.2-fpm stop
sleep 1
;;
restart)
echo "Restarting Nginx..."
sudo service nginx restart
sleep 1
echo "Restarting PHP7..."
sudo service php7.2-fpm restart
sleep 1
;;
status)
sudo service nginx status
sudo service php7.2-fpm status
exit 0
;;
*)
echo "Usage: `basename $0` [start|restart|stop|status]"
;;
esac