e-smith-dnscache/root/etc/e-smith/db/configuration/migrate/20DNSForwarders

23 lines
581 B
Plaintext
Raw Permalink Normal View History

{
my %props;
my $forwarder = $DB->get_value_and_delete('DNSPrimaryIP') ||
$DB->get_prop_and_delete('named', 'Forwarder1');
return "" unless defined $forwarder;
$props{'Forwarder'} = $forwarder;
$forwarder = $DB->get_value_and_delete('DNSSecondaryIP') ||
$DB->get_prop_and_delete('named', 'Forwarder2');;
if (defined $forwarder)
{
warn "DNS forwarder $forwarder deleted - support provided for only one";
}
my $dnscache = $DB->get('dnscache') || $DB->new_record('dnscache', { type => 'service' } );
$dnscache->merge_props(%props);
}