#!/bin/bash
SOCKETDIR=/var/run/saslauthd
MECH=shadow
FLAGS=
RETVAL=0
prog=saslauthd
path=/usr/local/sbin/saslauthd
start() {
echo $"Starting $prog: "
if [ ! -d /var/run/saslauthd ]; then
mkdir /var/run/saslauthd
fi
$path -m $SOCKETDIR -a $MECH
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/run/saslauthd/$prog
return $RETVAL
}
stop() {
echo $"Stopping $prog: "
kill `cat /var/run/saslauthd/saslauthd.pid`
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/run/saslauthd/$prog
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status $path
;;
condrestart)
[ -f /var/run/saslauthd/$prog ] && restart ¦¦ :
;;
*)
echo $"Usage: $0 {start¦stop¦status¦reload¦restart¦condrestart}"
exit 1
esac
exit $? |