-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfonzdev
More file actions
executable file
·39 lines (34 loc) · 859 Bytes
/
Copy pathfonzdev
File metadata and controls
executable file
·39 lines (34 loc) · 859 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
txtrst='\e[0m' # Text Reset
txtblu='\e[0;34m' # Blue
bldgrn='\e[1;32m' # Green
bldylw='\e[1;33m' # Yellow
bldred='\e[1;31m' # Red
# Require sudo powers for this
if [ "$(id -u)" != "0" ]; then
echo -e "${bldred} [x] You need to run this as root. ${txtrst}"
exit 1
fi
# Can only start/stop right now
if [ "$1" = "" ]; then
echo -e "${bldred} [x] Nothing to do.${txtrst}"
exit 1
fi
# Start apache/mysql
if [ "$1" = "start" ]; then
echo -e "${bldgrn} [>] Starting dev environment.${txtrst}"
echo -e $txtblu
service apache2 start
service mysql start
echo "Development environment started"
echo -e $txtrst
fi
# Stop apache/mysql
if [ "$1" = "stop" ]; then
echo -e "${bldylw} [>] Stopping dev environment.${txtrst}"
echo -e $txtblu
service apache2 stop
service mysql stop
echo "Development evnironment stopped"
echo -e $txtrst
fi