-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebapi-engine
executable file
·41 lines (39 loc) · 1.04 KB
/
webapi-engine
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
#! /bin/sh
### BEGIN INIT INFO
# Provides: webapi-engine
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: webapi-engine process events
# Description: webapi-engine processes evets and allows the setting up of rules
### END INIT INFO
# Description: webapi-engine processes evets and allows the setting up of rules
# Author: Dominic Bosch <[email protected]>
NAME=start-webapi-engine
DAEMON_PATH=/opt/webapi-eca
export PATH=$PATH:/usr/local/bin
export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules:$DAEMON_PATH/node_modules
case "$1" in
start)
echo -n "Starting webapi-engine: "
mkdir -p /var/run/forever/
exec forever start -p /var/run/forever $DAEMON_PATH/$NAME
echo "Done!"
;;
stop)
echo -n "Stopping webapi-engine: "
exec forever stop $DAEMON_PATH/$NAME
echo "Done!"
;;
restart)
echo "Restarting webapi-engine: "
exec forever restart $DAEMON_PATH/$NAME
echo "Done!"
;;
*)
echo "Usage: /etc/init.d/webapi-engine {start|stop|restart}"
exit 1
;;
esac
exit 0