# exec-monitor.pl
# Check if some command exits with non-zero status

sub get_exec_status
{
system("($_[0]->{'cmd'}) >/dev/null 2>&1 </dev/null");
return { 'up' => $?==0 ? 1 : 0 };
}

sub show_exec_dialog
{
print "<tr> <td><b>$text{'exec_cmd'}</b></td>\n";
print "<td colspan=3><input name=cmd size=50 value='$_[0]->{'cmd'}'></td>\n";
}

sub parse_exec_dialog
{
$in{'cmd'} || &error($text{'exec_ecmd'});
$_[0]->{'cmd'} = $in{'cmd'};
}

