initial commit of file from CVS for smeserver-bandwidthd on Sat Sep 7 20:10:36 AEST 2024
This commit is contained in:
16
root/etc/e-smith/db/configuration/migrate/80bandwidthd
Normal file
16
root/etc/e-smith/db/configuration/migrate/80bandwidthd
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
use MIME::Base64 qw(encode_base64);
|
||||
|
||||
my $rec = $DB->get('bandwidthd') || $DB->new_record('bandwidthd', {type => 'service'});
|
||||
|
||||
if (my $grapCutofff = $DB->get_prop_and_delete('bandwidthd', 'grapCutofff')) {
|
||||
$rec->merge_props('grapCutoff', $grapCutofff);
|
||||
}
|
||||
|
||||
|
||||
my $pw = $rec->prop('DbPassword');
|
||||
return "" if $pw;
|
||||
$pw = MIME::Base64::encode(int( (1000000000000000) * rand() ));
|
||||
chomp($pw);
|
||||
$rec->set_prop('DbPassword', "$pw" );
|
||||
}
|
Reference in New Issue
Block a user