-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart.sh
37 lines (28 loc) · 986 Bytes
/
start.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
#!/bin/sh
#####################################################################
# usage:
# sh start.sh -- start application @dev
# sh start.sh ${env} -- start application @${env}
# examples:
# sh start.sh prod -- use conf/nginx-prod.conf to start OpenResty
# sh start.sh -- use conf/nginx-dev.conf to start OpenResty
# note:
# export your own OpenResty in the path
#####################################################################
export PATH=$PATH:/home/tweyseo/deps/OR-1.13.6.2-pcrejit/bin
if [ -n "$1" ];then
PROFILE="$1"
else
PROFILE=dev
fi
if [ -f tmp/*-nginx.pid ]; then
echo -e "\033[41;33mduplicate OR, see "$(pwd)"/tmp/*-nginx.pid\033[0m"
exit 1
fi
if [ ! -f conf/nginx-${PROFILE}.conf ]; then
echo -e "\033[41;33minvalid profile: "${PROFILE}"\033[0m"
exit 1
fi
mkdir -p logs & mkdir -p logs/old_logs & mkdir -p tmp
echo -e "\033[32mstart OR application with profile: "${PROFILE}"\033[0m"
openresty -p $(pwd)/ -c conf/nginx-${PROFILE}.conf