Files
smeserver-support/root/etc/e-smith/db/configuration/migrate/20StatusReport
Jean-Philippe Pialasse 55dea32fc1 * Wed Mar 05 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-6.sme
- change key type from service to configuration [SME: 11367]
2025-03-05 23:19:51 -05:00

14 lines
490 B
Plaintext

{
my $rec = $DB->get('statusreport')
|| $DB->new_record('statusreport', { type => 'configuration' });
my %props = $rec->props;
exists $props{DayOfWeek} or $props{DayOfWeek} = int(rand(7));
exists $props{Hour} or $props{Hour} = int(rand(24));
exists $props{Minute} or $props{Minute} = int(rand(60));
$rec->merge_props(%props);
$DB->set_prop('statusreport', "type", "configuration") if ${'statusreport'}{type} eq "service";
}