People,

    I wrote the following perl script for checking /etc/amandapass for
validity.

#! /bin/perl
#
# Customize this to point to your smbclient
$smbclient = "/g/rcs/sw/bin/smbclient";

open (AP, "</etc/amandapass") || die "Unable to open the file
/etc/amandapass for reading";
while (<AP>)
{
  ( $sharename, $password ) = split ;
# The next line is for debugging the script.
#  print "working on $sharename, password should be $password\n";
  @args = ( $smbclient, $sharename, $password, "-c exit" );
  $status = system ( @args );
  print "Sharename $sharename has a ". ( $status == 0 ? "valid" :
"**INVALID**")." password\n";
};
close (AP) || die "Unable to close the file /etc/amandapass after
reading";

This is actually too crude - it won't handle commented lines or empty
lines properly, and it really ought to run off of the disklist file to
pick up the partition names.  I will develop this some more if people
express an interest.


Jeff


--
Jeff Silverman, sysadmin for the Research Computing Systems (RCS)
University of Washington, School of Engineering, Electrical Engineering Dept.
Box 352500, Seattle, WA, 98125-2500 FAX: (206) 221-5264 Phone (206) 543-9378
[EMAIL PROTECTED]     http://rcs.ee.washington.edu/~jeffs



Reply via email to