#!/home/product/code/webui-perl/bin/perl -T -I /home/product/code/firmware/current/lib/perl5
#SUDOER_USERS: nobody
#SUDOER_RUNAS_USERS: root, mta
#SUDOER_TAGS: NOPASSWD, EXEC
use warnings;
use strict;
use Barracuda::Sudo::Lib;
use IPC::Run qw(run);

###############################################################################

=pod

=head1 NAME

barracuda_raid

=head1 DESCRIPTION

Wraps calls to /usr/local/bin/barracuda_raid.pl that pass the uinfo or dinfo args.

=cut

###############################################################################

my $cmd = "/usr/local/bin/barracuda_raid.pl";

my @argv = get_argv(qr/^(uinfo)|(dinfo)$/);
my $outfile = sudo_out();
my $status = run([$cmd, @argv], \undef, $outfile, $outfile);

exit !$status;
