## OpenCA - Public Web-Gateway Command
## (c) 1999-2009 by Massimiliano Pala and OpenCA Group
## All Rights Reserved
##
##   File Name: stopAutoCRL
##       Brief: stop Auto (On-Line) CRL Daemon
##     Version: $Revision: 1.3 $
## Description: this script stops the On-Line CRL Daemon
##  Parameters: 

use strict;

sub cmdStopAutoCRL {

	my $pidfile = undef;
	my $pid = undef;

	$pidfile = $AUTOCONF{"var_prefix"}."/tmp/openca_autocrl.pid";
	$pid = libGetPidProcessStatus("$pidfile");

	if ($pid > 0)
	{
		if (POSIX::kill( $pid, 1) gt 0)
		{
			success (400, "The On-Line Daemon is now disabled!");
		}
		else
		{
			generalError("Can not kill the AutoCA daemon ($!)");
		}
	}

	return(1);
}

1;
