forked from lukeddy/tuer.me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tuer
executable file
·32 lines (31 loc) · 878 Bytes
/
tuer
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
#!/bin/bash
#chkconfig:345 99 01
#description:tuer
export PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'
export LD_LIBRARY_PATH='/usr/local/lib':$LD_LIBRARY_PATH
DIR='/home/tuer2.0'
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NODE_PATH='/home/tuer2.0/node_modules'
NODE=/usr/local/bin/node
test -x $NODE || exit 0
function start_app {
forever start "$DIR/index.js" -l "$DIR/logs/tuer.log" -o "$DIR/logs/tuer.out.log" -e "$DIR/logs/tuer.err.log"
forever start "$DIR/api.js" -l "$DIR/logs/tuer-api.log" -o "$DIR/logs/tuer-api.out.log" -e "$DIR/logs/tuer-api.err.log"
}
function stop_app {
forever stop "$DIR/index.js"
forever stop "$DIR/api.js"
}
case $1 in
start)
start_app ;;
stop)
stop_app ;;
restart)
stop_app
start_app
;;
*)
echo "usage: clearstonecc {start|stop}" ;;
esac
exit 0