smeserver-phppgadmin/root/etc/e-smith/db/configuration/migrate/phppgadmin

12 lines
311 B
Plaintext

{
my $rec = $DB->get('phppgadmin')
|| $DB->new_record('phppgadmin', {type => 'configuration'});
my $pw = $rec->prop('Password');
if (not $pw or length($pw) < 20){
my $pw = `/usr/bin/openssl rand -base64 28 | tr -c -d '[:alnum:]'`;
$rec->set_prop('Password', $pw);
}
}