#!/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 Barracuda::Environment;
use IPC::Run qw(run);

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

=pod

=head1 NAME

areca_cli

=head1 DESCRIPTION

Wraps calls to the areca command line utility. For now, the first argument is
limited to 'rsf' or 'vsf', and the second argument is limited to 'info'.

=cut

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

my $cmd = "${Barracuda::Environment::path_firmware}/bin/areca_cli";
my @argv = get_argv(qr/^(vsf)|(rsf)$/, qr/^info$/);
my $outfile = sudo_out();

my $status = run([$cmd, @argv], \undef, $outfile, $outfile);

exit !$status;
