Rev 4 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash## zarafa-gateway Zarafa Collaboration Platform's POP3/IMAP Gateway## chkconfig: 345 86 24# description: The Zarafa Gateway allows users \# to access their email using the POP3 or IMAP protocol.# processname: /usr/sbin/zarafa-gateway# config: /etc/zarafa/gateway.cfg# pidfile: /var/run/zarafa-gateway.pid### BEGIN INIT INFO# Provides: zarafa-gateway# 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 Platform's POP3/IMAP Gateway# Description: The Zarafa Gateway allows users# to access their email using the POP3 or IMAP protocol.### END INIT INFOGATEWAYCONFIG=/etc/zarafa/gateway.cfgGATEWAYPROGRAM=/usr/sbin/zarafa-gateway# Sanity checks.[ -x $GATEWAYPROGRAM ] || exit 0GATEWAYCONFIG_OPT=""[ ! -z $GATEWAYCONFIG -a -f $GATEWAYCONFIG ] && GATEWAYCONFIG_OPT="-c $GATEWAYCONFIG"[ -f /etc/sysconfig/zarafa ] && . /etc/sysconfig/zarafaif [ -z "$ZARAFA_LOCALE" ]; thenZARAFA_LOCALE="C"fi# Source function library.. /etc/rc.d/init.d/functionsRETVAL=0gateway=`basename $GATEWAYPROGRAM`lockfile=/var/lock/subsys/$gatewaypidfile=/var/run/$gateway.pidstart() {# Start in background, always succeedsecho -n $"Starting $gateway: "export LC_ALL=$ZARAFA_LOCALEexport LANG=$ZARAFA_LOCALEdaemon $GATEWAYPROGRAM $GATEWAYCONFIG_OPTRETVAL=$?unset LC_ALL LANGecho[ $RETVAL -eq 0 ] && touch $lockfilereturn $RETVAL}stop() {echo -n $"Stopping $gateway: "killproc $GATEWAYPROGRAMRETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfilereturn $RETVAL}restart() {stopstart}reload() {echo -n $"Restarting $gateway: "killproc $GATEWAYPROGRAM -SIGHUPRETVAL=$?echoreturn $RETVAL}# See how we were called.case "$1" instart)start;;stop)stop;;status)status $gatewayRETVAL=$?;;restart|force-reload)restart;;condrestart|try-restart)if [ -f ${pidfile} ]; thenstopstartfi;;reload)reload;;*)echo $"Usage: $gateway {start|stop|status|reload|restart|condrestart|force-reload|try-restart}"RETVAL=1;;esacexit $RETVAL