forked from massbitprotocol/massbitroute_gbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmd_server
More file actions
executable file
·62 lines (58 loc) · 1.22 KB
/
Copy pathcmd_server
File metadata and controls
executable file
·62 lines (58 loc) · 1.22 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
declare -i DEBUG=0
ROOT_DIR=$(cd "$(dirname $0)" && pwd)
source $ROOT_DIR/bin/shell_func.sh
# source $ROOT_DIR/scripts/base.sh
cd $ROOT_DIR
mkdir -p $ROOT_DIR/tmp $ROOT_DIR/logs/nginx $ROOT_DIR/logs $ROOT_DIR/db
if [ ! -f "$ROOT_DIR/src/env.lua" ]; then
loadEnv $ROOT_DIR >/dev/null
sleep 1
if [ ! -f "$ROOT_DIR/src/env.lua" ]; then
echo "$ROOT_DIR/src/env.lua not exists"
exit 1
fi
fi
case "$1" in
# install_libs)
# apt install -y libmaxminddb-dev uuid-dev
# for p in luafilesystem lpeg lua-messagepack; do
# /usr/local/openresty/luajit/bin/luarocks install $p
# done
# exit 0
# ;;
_env)
loadEnv $ROOT_DIR >/dev/null
sleep 1
if [ ! -f "$ROOT_DIR/src/env.lua" ]; then
echo "$ROOT_DIR/src/env.lua not exists"
exit 1
fi
exit 0
;;
_updateconf)
updateConfigs
exit 0
;;
_tests)
runTests
exit $?
;;
_update)
updateConfigs
$ROOT_DIR/bin/openresty/nginx/sbin/nginx -c $ROOT_DIR/tmp/nginx.conf -s reload
exit 0
;;
redis)
shift
$ROOT_DIR/bin/redis/bin/redis-cli -s $ROOT_DIR/tmp/redis.sock $@
exit 0
;;
nginx)
shift
$ROOT_DIR/bin/openresty/nginx/sbin/nginx -c $ROOT_DIR/tmp/nginx.conf $@
exit $?
;;
esac
updateConfigs
$ROOT_DIR/bin/python_env/gbc/bin/supervisorctl -c $ROOT_DIR/tmp/supervisord.conf $@