initial commit of file from CVS for e-smith-tinydns on Wed 12 Jul 09:11:00 BST 2023
This commit is contained in:
@@ -0,0 +1 @@
|
||||
53
|
@@ -0,0 +1 @@
|
||||
localhost
|
@@ -0,0 +1 @@
|
||||
enabled
|
1
root/etc/e-smith/db/configuration/defaults/tinydns/type
Normal file
1
root/etc/e-smith/db/configuration/defaults/tinydns/type
Normal file
@@ -0,0 +1 @@
|
||||
service
|
11
root/etc/e-smith/db/configuration/migrate/tinydns_ListenIP
Normal file
11
root/etc/e-smith/db/configuration/migrate/tinydns_ListenIP
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
# $tinydns{ListenIP} must not be set in serveronly mode
|
||||
my $tinydns = $DB->get('tinydns');
|
||||
return unless $tinydns;
|
||||
my $mode = $DB->get_value('SystemMode');
|
||||
return unless $mode;
|
||||
if ($mode eq 'serveronly')
|
||||
{
|
||||
$tinydns->delete_prop("ListenIP");
|
||||
}
|
||||
}
|
30
root/etc/e-smith/db/hosts/migrate/20tinydns
Normal file
30
root/etc/e-smith/db/hosts/migrate/20tinydns
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
use esmith::ConfigDB;
|
||||
my $confdb = esmith::ConfigDB->open_ro;
|
||||
return unless $confdb;
|
||||
|
||||
my $systemname = $confdb->get_value('SystemName');
|
||||
my $domainname = $confdb->get_value('DomainName');
|
||||
return unless $systemname && $domainname; # nothing to do
|
||||
|
||||
my $fqdn = "$systemname.$domainname";
|
||||
|
||||
# Make sure that the ReverseDNS property of the proper name of the server
|
||||
# is set to "yes", unless the $LocalIP has a configured PTR record already.
|
||||
my $self_host = undef;
|
||||
foreach my $host ( $DB->get_all() )
|
||||
{
|
||||
next unless $host->prop('HostType') eq 'Self';
|
||||
if ( $host->{key} eq $fqdn )
|
||||
{
|
||||
$self_host = $host;
|
||||
}
|
||||
if ( $host->prop('ReverseDNS')
|
||||
&& ( $host->prop('ReverseDNS') eq 'yes' ) )
|
||||
{
|
||||
# It already has one configured. Nothing to do.
|
||||
return;
|
||||
}
|
||||
}
|
||||
$self_host->set_prop( 'ReverseDNS', 'yes' ) if $self_host;
|
||||
}
|
Reference in New Issue
Block a user