initial commit of file from CVS for smeserver-dirty-tools on Sat Sep 7 20:17:20 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:17:20 +10:00
parent 2afadab596
commit d11a58da6a
14 changed files with 789 additions and 2 deletions

View File

@@ -0,0 +1,35 @@
#!/usr/bin/perl
# (C) 2005-2008 Michael Weinberger
# See http://wiki.contribs.org/Dirty_Tools for full documentation
use strict;
use esmith::ConfigDB;
use esmith::FormMagick;
use esmith::PasswordTools;
use Getopt::Long;
my %opts;
my $getRes = GetOptions(
"number=s"=>\$opts{'number'},
"length=s"=>\$opts{'length'},
"mixed-case"=>\$opts{'mixed-case'},
"add-consonants"=>\$opts{'add-consonants'},
"help"=>\$opts{'help'},
);
if( $opts{'help'} )
{
print "Usage: dt-pw-generate [--length=N] [--mixed-case] [--add-consonants]\n";
exit 0;
}
for(my $i=0; $i<($opts{'number'}?$opts{'number'}:1); $i++)
{
my $pw=sme_generate_password(
$opts{'length'} ? $opts{'length'} : 8,
$opts{'add-consonants'} ? 'yes' : 'no',
$opts{'mixed-case'} ? 'yes' : 'no',
);
print "$pw\n";
}