Subversion Repositories configs

Rev

Rev 43 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/bash
2
#
3
# zarafa-ical Zarafa Collaboration Platoform's iCal Gateway
4
#
5
# chkconfig: 345 86 24
6
# description: The Zarafa iCal Gateway allows users \
7
#              to access their calender using the iCal or CalDAV protocol.
8
# processname: /usr/bin/zarafa-ical
9
# config: /etc/zarafa/ical.cfg
10
# pidfile: /var/run/zarafa-ical.pid
11
 
12
### BEGIN INIT INFO
13
# Provides: zarafa-ical
14
# Required-Start: $local_fs $network $remote_fs $syslog
15
# Required-Stop: $local_fs $network $remote_fs $syslog
16
# Should-Start: zarafa-server
17
# Should-Stop: zarafa-server
18
# Short-Description: Zarafa Collaboration Platoform's iCal Gateway
19
# Description: The Zarafa iCal Gateway allows users
20
#              to access their calender using the iCal or CalDAV protocol.
21
### END INIT INFO
22
 
23
ICALCONFIG=/etc/zarafa/ical.cfg
24
ICALPROGRAM=/usr/bin/zarafa-ical
25
 
26
# Sanity checks.
27
[ -x $ICALPROGRAM ] || exit 0
28
 
29
ICALCONFIG_OPT=""
30
[ ! -z $ICALCONFIG -a -f $ICALCONFIG ] && ICALCONFIG_OPT="-c $ICALCONFIG"
31
 
32
[ -f /etc/sysconfig/zarafa ] && . /etc/sysconfig/zarafa
33
if [ -z "$ZARAFA_LOCALE" ]; then
34
	ZARAFA_LOCALE="C"
35
fi
36
 
37
# Source function library.
38
. /etc/rc.d/init.d/functions
39
 
40
RETVAL=0
41
ical=`basename $ICALPROGRAM`
42
lockfile=/var/lock/subsys/$ical
43
pidfile=/var/run/$ical.pid
44
 
45
start() {
46
	# Start in background, always succeeds
47
	echo -n $"Starting $ical: "
48
	export LC_ALL=$ZARAFA_LOCALE
49
	export LANG=$ZARAFA_LOCALE
50
	daemon $ICALPROGRAM $ICALCONFIG_OPT
51
	RETVAL=$?
52
	unset LC_ALL LANG
53
	echo
54
	[ $RETVAL -eq 0 ] && touch $lockfile
55
 
56
	return $RETVAL
57
}
58
 
59
stop() {
60
	echo -n $"Stopping $ical: "
61
	killproc $ICALPROGRAM
62
	RETVAL=$?
63
	echo
64
	[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile
65
 
66
	return $RETVAL
67
}
68
 
69
restart() {
70
	stop
71
	start
72
}
73
 
74
reload() {
75
	echo -n $"Restarting $ical: "
76
	killproc $ICALPROGRAM -SIGHUP
77
	RETVAL=$?
78
	echo
79
 
80
	return $RETVAL
81
}
82
 
83
# See how we were called.
84
case "$1" in
85
    start)
86
		start
87
		;;
88
    stop)
89
		stop
90
		;;
91
    status)
92
		status $ical
93
		RETVAL=$?
94
		;;
95
    restart|force-reload)
96
		restart
97
		;;
98
    condrestart|try-restart)
99
		if [ -f ${pidfile} ]; then
100
			stop
101
			start
102
		fi
103
		;;
104
    reload)
105
		reload
106
		;;
107
    *)
108
		echo $"Usage: $ical {start|stop|status|reload|restart|condrestart|force-reload|try-restart}"
109
		RETVAL=1
110
		;;
111
esac
112
 
113
exit $RETVAL