#!/bin/sh
#
#  Restart the SASL authentication daemon if it's not running.

PATH="$PATH":/usr/sbin:/sbin

if [ "$1" != "--force" ]
then
	/usr/bin/pgrep saslauthd 2>/dev/null >/dev/null && exit 0
fi

/etc/init.d/saslauthd stop >/dev/null 2>&1
sleep 1
/etc/init.d/saslauthd stop >/dev/null 2>&1
sleep 1
/etc/init.d/saslauthd stop >/dev/null 2>&1
sleep 1
/etc/init.d/saslauthd start >/dev/null 2>&1
