#!/usr/local/bin/perl
# stop.cgi
# Stop the running sendmail process

require './sendmail-lib.pl';
&ReadParse();
$access{'stop'} || &error("You are not allowed to stop sendmail");
$whatfailed = "Failed to stop sendmail";
if ($config{'sendmail_stop_command'}) {
	$out = &backquote_logged("$config{'sendmail_stop_command'} </dev/null 2>&1");
	if ($?) { &error("<pre>$out</pre>"); }
	}
else {
	&kill_logged('KILL', $in{'pid'});
	unlink($config{'sendmail_pid'});
	}
&webmin_log("stop");
&redirect("");

