Rev 43 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash## zarafa-ical Zarafa Collaboration Platoform's iCal Gateway## chkconfig: 345 86 24# description: The Zarafa iCal Gateway allows users \# to access their calender using the iCal or CalDAV protocol.# processname: /usr/sbin/zarafa-ical# config: /etc/zarafa/ical.cfg# pidfile: /var/run/zarafad/ical.pid### BEGIN INIT INFO# Provides: zarafa-ical# Required-Start: $local_fs $network $remote_fs $syslog# Required-Stop: $local_fs $network $remote_fs $syslog# Should-Start: zarafa-server# Should-Stop: zarafa-server# Short-Description: Zarafa Collaboration Platoform's iCal Gateway# Description: The Zarafa iCal Gateway allows users# to access their calender using the iCal or CalDAV protocol.### END INIT INFOICALCONFIG=/etc/zarafa/ical.cfgICALPROGRAM=/usr/sbin/zarafa-ical# Sanity checks.[ -x $ICALPROGRAM ] || exit 0ICALCONFIG_OPT=""[ ! -z $ICALCONFIG -a -f $ICALCONFIG ] && ICALCONFIG_OPT="-c $ICALCONFIG"[ -f /etc/sysconfig/zarafa ] && . /etc/sysconfig/zarafaif [ -z "$ZARAFA_LOCALE" ]; thenZARAFA_LOCALE="C"fi# Source function library.. /etc/rc.d/init.d/functionsRETVAL=0ical=`basename $ICALPROGRAM`lockfile=/var/lock/subsys/$icalpidfile=/var/run/zarafad/ical.pidstart() {# Start in background, always succeedsecho -n $"Starting $ical: "install -dm0775 -o zarafa -g zarafa /var/run/zarafadexport LC_ALL=$ZARAFA_LOCALEexport LANG=$ZARAFA_LOCALEdaemon $ICALPROGRAM $ICALCONFIG_OPTRETVAL=$?unset LC_ALL LANGecho[ $RETVAL -eq 0 ] && touch $lockfilereturn $RETVAL}stop() {echo -n $"Stopping $ical: "killproc $ICALPROGRAMRETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfilereturn $RETVAL}restart() {stopstart}reload() {echo -n $"Restarting $ical: "killproc $ICALPROGRAM -SIGHUPRETVAL=$?echoreturn $RETVAL}# See how we were called.case "$1" instart)start;;stop)stop;;status)status $icalRETVAL=$?;;restart|force-reload)restart;;condrestart|try-restart)if [ -f ${pidfile} ]; thenstopstartfi;;reload)reload;;*)echo $"Usage: $ical {start|stop|status|reload|restart|condrestart|force-reload|try-restart}"RETVAL=1;;esacexit $RETVAL