-
Notifications
You must be signed in to change notification settings - Fork 0
/
app
executable file
·45 lines (40 loc) · 792 Bytes
/
app
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
#!/bin/bash
# @file To start nodejs program
# @author guillain <guillain@gmail.com>
# @license GPL-3.0
# @settings:
# @@ dev
# @@ prod
#
APP='digitaldelegation.js'
APP_DIR='/var/www/digitalDelegation'
LOG_DIR="${APP_DIR}/log"
# For the manual mode and the tunneling
# ngrok http 80
# lt -s mytest -p 80
cd "${APP_DIR}"
case $1 in
start)
pm2 start "${APP}" \
--log "${LOG_DIR}/all.log" \
--output "${LOG_DIR}/app.log" \
--error "${LOG_DIR}/err.log" \
--merge-logs \
--log-date-format="YYYY-MM-DD HH:mm Z"
;;
stop)
pm2 stop "${APP}";;
restart)
$0 stop
$0 start
;;
show)
pm2 show "${APP}";;
status)
pm2 status "${APP}";;
log)
pm2 log "${APP}";;
manual)
DEBUG=* node "${APP}";;
*) echo "command not found";;
esac