e-smith-domains/root/etc/e-smith/db/domains/migrate/20nameservers

31 lines
715 B
Perl

{
# vim: ft=perl ts=4 sw=4 et:
use esmith::ConfigDB;
my $db = esmith::ConfigDB->open_ro;
for my $domain ( $DB->get_all )
{
my %props = $domain->props;
if (exists $props{Nameserver})
{
$props{Nameservers} ||= $props{Nameserver};
$domain->delete_prop("Nameserver");
}
if (($props{Nameservers} || '') eq 'corporate')
{
$props{Nameservers} = ''
unless ($db->get_prop('dnscache', 'Forwarder'));
}
$props{Nameservers} ||= (($props{SystemPrimaryDomain}||'no') eq 'yes') ?
'localhost' : 'internet';
$domain->merge_props(%props);
}
}