Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > 63fff99add596b34f7a098db106b0ada > files > 1

cyrus-sasl-2.1.12-1mdk.i586.rpm

#!/bin/sh
#
# saslauthd	SASL AUTH Daemon
#
# chkconfig:	2345 40 60
# description:	SASL AUTH Daemon
# processname:	saslauthd
# pidfile:	/var/state/sasl/mux.pid

# $Id: saslauthd.init,v 1.1 2001/05/02 10:55:48 wiget Exp $

# Source function library
. /etc/rc.d/init.d/functions

# Get service config
[ -f /etc/sysconfig/saslauthd ] && . /etc/sysconfig/saslauthd

if [ "x$SASL_AUTHMECH" != "x" ] ; then
	SASLAUTHD_OPTS="$SASLAUTHD_OPTS -a $SASL_AUTHMECH"
fi

if [ "x$SASL_RIMAP_HOSTNAME" != "x" ] ; then
	SASLAUTHD_OPTS="$SASLAUTHD_OPTS -H $SASL_RIMAP_HOSTNAME"
fi

# (!!) next line -really- needs the trailing backslash (it's because gprintf will wrongly substitute itself for echo and the rest)
if echo $SASL_TIME_OF_DAY_LOGIN_RESTRICTIONS \
    | grep -q '^[Yy][Ee]\?[Ss]\?$' ; then
	SASLAUTHD_OPTS="$SASLAUTHD_OPTS -T"
fi

# See how we were called.
case "$1" in
  start)
	# Check if the service is already running?
        if [ ! -f /var/lock/subsys/saslauthd ]; then
		gprintf "Starting saslauthd"
		daemon saslauthd $SASLAUTHD_OPTS
		echo
	        RETVAL=$?
    		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/saslauthd
	else
        	gprintf "saslauthd already running"
		echo
	        exit 1
	fi
	;;
  stop)
        # Stop daemons.
	if [ -f /var/lock/subsys/saslauthd ]; then
                gprintf "Stopping saslauthd"
                killproc saslauthd
		echo
                rm -f /var/lock/subsys/saslauthd /var/run/saslauthd.pid >/dev/null 2>&1
        else
		gprintf "saslauthd not running"
		echo
	        exit 1
	fi
	;;
  status)
	status saslauthd
	exit $?
	;;
  restart|reload)
	$0 stop
	$0 start
	;;
  *)
	gprintf "%s {start|stop|restart|status}\n" "$0"
	exit 1
	;;
esac

exit $RETVAL