smeserver-automysqlbackup/root/etc/e-smith/db/configuration/migrate/85automysqlbackup

18 lines
577 B
Plaintext

{
my $rec = $DB->get('automysqlbackup') || $DB->new_record('automysqlbackup', { type => 'webapp' });
my $pw = $rec->prop('DbPassword');
if (not $pw){
$pw = `/usr/bin/openssl rand -base64 60 | tr -c -d '[:graph:]'`;
chomp($pw);
$rec->set_prop('DbPassword', $pw);
}
# if mysql53 exists; ie before tidying the contrib : there is no mysql53 on SME, 5.1 or 5.5
#delete Mymaria Mysql53 Mysql55 Mysql57; so we use the default as hardcoded in scripts
if ( defined $rec->prop('Mysql53') ){
$rec->delete_prop($_) for ( qw(Mymaria Mysql53 Mysql55 Mysql57) );
}
}