]> err.no Git - scalable-opengroupware.org/blob - Scripts/sogo-init.d-redhat
ad94d06bf8fcdefd9a983c4fe48cf8fc7c857c05
[scalable-opengroupware.org] / Scripts / sogo-init.d-redhat
1 #!/bin/bash
2 #
3 # sogod         Scalable OpenGroupware.org (Inverse edition)
4 #
5 # chkconfig:    - 85 15
6 # description:  SOGo is a groupware server
7 # processname:  sogod-0.9
8 # config:       /etc/sysconfig/sogo
9 # config:       /etc/httpd/conf.d/SOGo.conf
10 # pidfile:      /var/run/sogo/sogod.pid
11
12 PATH=/sbin:/bin:/usr/sbin:/usr/bin
13
14 . /etc/rc.d/init.d/functions
15
16 DAEMON=/usr/sbin/sogod
17 NAME=sogo
18 DESC="Scalable OpenGroupware.Org (Inverse edition)"
19
20 PIDFILE=/var/run/sogo/sogod.pid
21
22 SOGO_ARGS=""
23
24 if [ -f /etc/sysconfig/sogo ]; then
25     . /etc/sysconfig/sogo
26 fi
27
28 test -x $DAEMON || exit 0
29
30 #set -e
31
32 case "$1" in
33   start)
34         echo -n $"Starting $DESC: " / 
35         daemon --user sogo --pidfile $PIDFILE $DAEMON
36         echo "$NAME."
37         ;;
38   stop)
39         echo -n $"Stopping $DESC: "
40         killproc --pidfile $PIDFILE $DAEMON
41         rm -f $PIDFILE
42         echo "$NAME."
43         ;;
44   restart|force-reload)
45         echo -n $"Restarting $DESC: "
46         killproc --pidfile $PIDFILE $DAEMON
47         rm -f $PIDFILE
48         sleep 1
49         daemon --user sogo --pidfile $PIDFILE $DAEMON
50         echo "$NAME."
51         ;;
52   status)
53         status $DAEMON
54         ;;
55   *)
56         N=/etc/init.d/$NAME
57         echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
58         exit 1
59         ;;
60 esac
61
62 exit 0
63