#!/usr/local/bin/perl
# start_hostsentry.cgi
# Start the hostsentry daemon

require './sentry-lib.pl';
&error_setup($text{'hostsentry_starterr'});

$cmd = &hostsentry_start_cmd();
$temp = &tempname();
&system_logged("$cmd >$temp 2>&1 </dev/null");
open(TEMP, $temp);
while(<TEMP>) { $out .= $_; }
close(TEMP);
unlink($temp);
&error("<tt>$out</tt>") if ($out =~ /failed|error/i);
&webmin_log("start", "hostsentry");

&redirect("edit_hostsentry.cgi");

