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