#!/usr/local/bin/perl
# restart.cgi
# Restart the mon process

require './mon-lib.pl';
&error_setup($text{'restart_err'});
if ($config{'restart_cmd'}) {
	$out = &backquote_logged("$config{'restart_cmd'} 2>&1 </dev/null");
	&error("<tt>$out</tt>") if ($?);
	}
else {
	if (open(PID, $config{'pid_file'}) && chop($pid = <PID>)) {
		kill('HUP', $pid);
		close(PID);
		}
	else {
		&error($text{'restart_epid'});
		}
	}
&redirect("");

