* Frank Dietrich <[EMAIL PROTECTED]> [18-12-2005 15:07]: > Das mit dem Script werde ich auf jeden Fall noch machen. Ohne ein > solches ist die Ausgabe wirklich nicht sonderlich User-freundlich. Hi, hab mal schnell ein Skript zusammengebastelt, nicht sehr schön - erfüllt aber sein Zweck. (libdate-manip-perl muss installiert sein)
#!/usr/bin/perl
use strict;
use warnings;
use IO::File;
use Date::Manip;
my $pipe = IO::File->new("passwd -S |") || die "pipe error: $!\n";
my $data = <$pipe>;
my ($user, $status ,$update, $min, $max, $warn, $inactive) = split(/ /, $data);
print "user login .....................: $user\n";
if ($status eq 'P'){
print "user account ...................: has a usable password\n";
}elsif ($status eq 'NP'){
print "user account ...................: has no password\n";
}elsif ($status eq 'L'){
print "user account ...................: is locked\n";
}
print "last password change ...........: $update\n";
print "minimum age ....................: $min day(s)\n";
print "maximum age ....................: $max day(s)\n";
if ($warn > 0){
print "warning period .................: $warn day(s)\n";
}
if ($inactive > 0){
print "inactivity period ..............: $inactive day(s)\n";
}
my $target = &UnixDate(&ParseDate(&DateCalc($update, "+ ${max}days")),
"%m/%d/%Y");
print "next password change ...........: $target\n";
exit 0;
### eof
Gruss Uwe
signature.asc
Description: Digital signature

