From 62086547910b4f73ae63c8c349a20f2718426e2f Mon Sep 17 00:00:00 2001 From: Arnaud Desmons Date: Tue, 3 Sep 2002 13:27:23 +0000 Subject: added some fillfunc's --- dns_wizard/dns.wiz | 19 ++++--------------- dns_wizard/scripts/Dnsconf.pm | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 15 deletions(-) (limited to 'dns_wizard') diff --git a/dns_wizard/dns.wiz b/dns_wizard/dns.wiz index b9225c0b..b808e29d 100644 --- a/dns_wizard/dns.wiz +++ b/dns_wizard/dns.wiz @@ -93,7 +93,7 @@ name="wiz_ext_dns1" variableName="wiz_ext_dns1" helpText="Primary DNS Address:" - fillScript="get_var wiz_ext_dns1" + fillfunc="get_dns1" editable="true" > @@ -102,7 +102,7 @@ name="wiz_ext_dns2" variableName="wiz_ext_dns2" helpText="Secondary DNS Address:" - fillScript="get_var wiz_ext_dns2" + fillfunc="get_dns2" editable="true" > @@ -210,26 +210,15 @@ needed to configure your DNS service:" > - - - - - - - - new(); +my $dns1; +my $dns2; + +my $file = "/etc/named.conf"; +open (NEW, "< $file"); +DNS : while () { + $dns2 = ""; + if (m/^\s*options\s*\{/s...m/^\s*\}\;/s ) { + if (m/^\s*forwarders\s*\{/s...m/^\s*\}\;/s ) { + if (/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/) { + $dns2 = "$1.$2.$3.$4"; + $dns1 and next DNS; + $dns1 = $dns2; + } + } + } +} +close (NEW); + +sub get_dns1 { + $dns1; +} + +sub get_dns2 { + $dns2; +} + sub up_serial { my ($file) = @_; -- cgit v1.2.1