]> matita.cs.unibo.it Git - helm.git/blob - helm/scripts/init.d/helm-http-getter
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / scripts / init.d / helm-http-getter
1 #!/bin/sh
2 #
3 # init.d script for http_getter.pl
4 #
5 # by --Zack <zack@cs.unibo.it>
6 # Created: Tue,  8 Oct 2002 17:18:17 +0200
7 # Last-Modified: Tue,  8 Oct 2002 17:18:17 +0200
8
9 DAEMON=/projects/helm/http_getter/http_getter.pl
10 USAGE="Usage: /etc/init.d/helm-http-getter { start | stop | restart }"
11
12 ENVSCRIPT=""
13 if [ -f /etc/default/helm ]; then
14   . /etc/default/helm
15 fi
16 if ! [ -f "$ENVSCRIPT" ]; then
17   echo "Can't find environment script '$ENVSCRIPT'"
18   exit 1
19 fi
20 . $ENVSCRIPT &> /dev/null
21
22 NAME=`basename $DAEMON`
23 PIDFILE=/projects/helm/run/$NAME.pid
24
25 do_start () {
26   echo "Starting $DAEMON ..."
27   start-stop-daemon \
28     --start --background --pidfile $PIDFILE --make-pidfile \
29     --chuid $OWNER --exec $DAEMON
30 }
31
32 do_stop () {
33   echo "Stopping $DAEMON ..."
34   start-stop-daemon --stop --pidfile $PIDFILE && \
35   (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
36 }
37
38 case "$1" in
39
40   start)
41     do_start
42     ;;
43
44   stop)
45     do_stop
46     ;;
47
48   restart)
49     do_stop
50     do_start
51     ;;
52
53   *)
54     echo "$USAGE" >&2
55     exit 1
56     ;;
57
58 esac
59