#!/usr/bin/perl -I/opt/SUNWstade/lib
use System;
use Getopt::Std;

System->set_home("/opt/SUNWstade");

sub usage {
  print "Usage: saveArrayPassword -n <password> -h\n";
  print "        -n BLANK  : clear the password \n";
  print "  This will save the Storage Array password in System/passwords/array\n";
  print "\n";
}
if (!getopts("n:h", \%opts) || $opts{h} || !$opts{n}) {
    print "Invalid argument(s) \n";
    usage();
    exit(1);
}

$new = $opts{n};

print "Updating System/passwords/array\n";

$new = "" if ($opts{n} eq "BLANK");

System->setPassword("array", $new);
