#!/usr/bin/perl -I/usr/local/lib/perl5 --  # -*-Perl-*-
#
# build_array_list.pl - script to enumerate arrays and build the list
# in a temp file
#
# Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"@(#)build_array_list	1.4	04/04/26 SMI
#

my ($idx) = 0;
my ($adminID);
my ($classPath) = "/opt/wsi/lib/wbem.jar:"
	. "/opt/se6x20/tools/se6x20Utils.jar";
my ($nameSpace) = "/root/se6x20";
my ($javaCmd) = "/usr/bin/java -cp $classPath "
	. "com.sun.netstorage.array.mgmt.tools.ListT4 $nameSpace |";

# change our UID/EUID to 'admin'
$adminID = getpwnam ('admin');

$< = $adminID;
$> = $adminID;

open ARRAYLIST, $javaCmd or exit 101;

while (<ARRAYLIST>) {
	print;
}

close ARRAYLIST ;

# check error return of ListT4.
$? && die;
