1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-24 04:33:24 +00:00
freebsd-ports/mail/majordomo/scripts/makeseed
2001-07-24 04:21:42 +00:00

15 lines
439 B
Perl

#!/usr/bin/perl
my $file = $ARGV[0];
my $seed = '';
my $i;
my $patt = "./0123456789abcdefghijklmnopqrstuvwxyzQWERTYUIOPASDFGHJKLZXCVBNM";
die unless $file;
srand;
for( $i = 1; $i <= 40; $i++ ) {
$seed = $seed . substr( $patt, int( rand() * 64 ), 1 );
}
open OUT, ">>$file" || die "Cannot open output file";
print OUT "\n## Set cookie_seed to value generated during install\n";
printf OUT '$cookie_seed="%s";'."\n", $seed;
close( OUT );