#!/bin/sh
. /etc/rc.common
StartService ()
{
    if [ "${AMAVIS:=-NO-}" = "-YES-" ]; then
    ConsoleMessage "Starting AMAVIS"
	su mailtransport -c amavisd
	else
	NoService
    fi
}
StopService ()
{
    ConsoleMessage "Stoping AMAVIS"
    amavisd stop
}
RestartService ()
{
    if [ "${AMAVIS:=-NO-}" = "-YES-" ]; then
    ConsoleMessage "Reloading AMAVIS"
    StopService
    StartService
    else
    StopService
	NoService
    fi
}

NoService ()
{
	ConsoleMessage "Service is disabled in /etc/hostconfig
	
	Unable to start
	"
}

RunService "$1"
