-
Notifications
You must be signed in to change notification settings - Fork 0
/
bots-webserverd.sh
37 lines (35 loc) · 1.13 KB
/
bots-webserverd.sh
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
#! /bin/sh
#
# uses 'start-stop-daemon' , which is used in debian/ubuntu
#
#~ PATH=/sbin:/usr/sbin:/bin:/usr/bin
DEVDIR="/home/hje/Bots/botsdev/"
NAME=bots-webserver
PIDFILE=$DEVDIR$NAME"_dev.pid"
DAEMON="/usr/bin/python2.7"
DAEMON_ARGS=$DEVDIR"bots-webserver.py"
case "$1" in
start)
echo "Starting "$NAME" "
start-stop-daemon --start --verbose --background --pidfile $PIDFILE --make-pidfile --startas $DAEMON -- $DAEMON_ARGS
;;
stop)
echo "Stopping "$NAME" "
start-stop-daemon --stop --verbose --pidfile $PIDFILE
rm -f $PIDFILE
;;
restart)
echo "Restarting "$NAME" "
start-stop-daemon --stop --verbose --pidfile $PIDFILE
rm -f $PIDFILE
sleep 1
start-stop-daemon --start --verbose --background --pidfile $PIDFILE --make-pidfile --startas $DAEMON -- $DAEMON_ARGS
;;
*)
echo "Usage: ""$(basename "$0")"" {start|stop|restart}"
echo " Starts the bots webserver as a daemon."
echo " Bots-webserver is part of bots open source edi translator (http://bots.sourceforge.net)."
exit 1
;;
esac
exit 0