]> matita.cs.unibo.it Git - helm.git/blob - helm/scripts/init.d/helm-uwobo_mowgli
added loading of stylesheets on start/restart
[helm.git] / helm / scripts / init.d / helm-uwobo_mowgli
1 #!/bin/sh
2 #
3 # init.d script for http_getter
4 #
5 # by --Zack <zack@cs.unibo.it>
6 # Created: Wed, 15 Jan 2003 15:14:07 +0100
7 # Last-Modified: Wed, 15 Jan 2003 15:14:07 +0100
8
9 DAEMON="/projects/helm/uwobo_mowgli/uwobo"
10 USAGE="Usage: /etc/init.d/helm-uwobo_mowgli { start | stop | restart }"
11
12 ENVSCRIPT=""
13 if [ -f /etc/default/helm_mowgli ]; then
14   . /etc/default/helm_mowgli
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"_mowgli.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   /etc/init.d/helm-tomcat_mowgli start
31 }
32
33 do_stop () {
34   echo "Stopping $DAEMON ..."
35   start-stop-daemon --stop --pidfile $PIDFILE && \
36   (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
37 }
38
39 case "$1" in
40
41   start)
42     do_start
43     ;;
44
45   stop)
46     do_stop
47     ;;
48
49   restart)
50     do_stop
51     do_start
52     ;;
53
54   *)
55     echo "$USAGE" >&2
56     exit 1
57     ;;
58
59 esac
60