forked from xasos/UIUC-API
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.sh
More file actions
executable file
·58 lines (45 loc) · 779 Bytes
/
app.sh
File metadata and controls
executable file
·58 lines (45 loc) · 779 Bytes
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
#!/bin/sh
DAEMON=/usr/bin/python
APPDIR="/home/ec2-user/application_backend/UIUC-API"
PARAMETERS="$APPDIR/app.py"
LOGFILE="$APPDIR/daemon.log"
start() {
echo -n "starting up $DAEMON"
RUN=`cd / && $DAEMON $PARAMETERS > $LOGFILE 2>&1 &`
if [ "$?" -eq 0 ]; then
echo "Done."
else
echo "FAILED."
fi
}
stop() {
killall $DAEMON
}
status() {
killall -0 $DAEMON
if [ "$?" -eq 0 ]; then
echo "Running."
else
echo "Not Running."
fi
}
case "$1" in
start)
start
;;
restart)
stop
sleep 2
start
;;
stop)
stop
;;
status)
status
;;
*)
echo "usage : $0 start|restart|stop|status"
;;
esac
exit 0