smeserver-hosts/root/etc/e-smith/db/hosts/migrate/10sanitise-db

23 lines
346 B
Plaintext

{
foreach my $host ($DB->get_all)
{
my $lc_key = lc($host->key);
next if ( $lc_key eq $host->key );
my $rec = $DB->get($lc_key);
if ($rec)
{
warn "HostsDB: " . $host->key .
" NOT migrated as $lc_key exists\n";
next;
}
$rec = $DB->new_record($lc_key);
$rec->merge_props($host->props);
$host->delete;
}
}