]> matita.cs.unibo.it Git - helm.git/blob - helm/scripts/init.d/helm-draw-graph
ocaml 3.09 transition
[helm.git] / helm / scripts / init.d / helm-draw-graph
1 #!/bin/sh
2 #
3 # init.d script for HELM draw_graph.cgi
4 #
5 # by --Zack <zack@cs.unibo.it>
6 # Created: Wed,  9 Oct 2002 11:12:01 +0200
7 # Last-Modified: Wed,  9 Oct 2002 11:12:01 +0200
8
9 DAEMON=/projects/helm/daemons/graphs/tools/drawGraph.opt
10 USAGE="Usage: /etc/init.d/helm-draw-graph { start | stop | restart }"
11
12 if [ -f /etc/default/helm ]; then
13   . /etc/default/helm
14 fi
15
16 NAME=`basename $DAEMON`
17 PIDFILE=/var/run/"$NAME".pid
18
19 do_start () {
20   echo "Starting $DAEMON ..."
21   start-stop-daemon \
22     --start --background --pidfile $PIDFILE --make-pidfile \
23     --chuid $OWNER --exec $DAEMON
24 }
25
26 do_stop () {
27   echo "Stopping $DAEMON ..."
28   start-stop-daemon --stop --pidfile $PIDFILE && \
29   (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
30 }
31
32 case "$1" in
33
34   start)
35     do_start
36     ;;
37
38   stop)
39     do_stop
40     ;;
41
42   restart)
43     do_stop
44     do_start
45     ;;
46
47   *)
48     echo "$USAGE" >&2
49     exit 1
50     ;;
51
52 esac
53