diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-09-03 13:27:23 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-09-03 13:27:23 +0000 |
commit | 62086547910b4f73ae63c8c349a20f2718426e2f (patch) | |
tree | 600a88891a65e8b829877635ecf11c879a338c4e /dns_wizard | |
parent | 386b7879607eaaa5284d68b6c75e2fd16561c9a9 (diff) | |
download | drakwizard-62086547910b4f73ae63c8c349a20f2718426e2f.tar drakwizard-62086547910b4f73ae63c8c349a20f2718426e2f.tar.gz drakwizard-62086547910b4f73ae63c8c349a20f2718426e2f.tar.bz2 drakwizard-62086547910b4f73ae63c8c349a20f2718426e2f.tar.xz drakwizard-62086547910b4f73ae63c8c349a20f2718426e2f.zip |
added some fillfunc's
Diffstat (limited to 'dns_wizard')
-rw-r--r-- | dns_wizard/dns.wiz | 19 | ||||
-rw-r--r-- | dns_wizard/scripts/Dnsconf.pm | 27 |
2 files changed, 31 insertions, 15 deletions
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" > </Freetext> @@ -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" > </Freetext> @@ -210,26 +210,15 @@ needed to configure your DNS service:" > </Info> - - <Info - helpText="Primary DNS Address:" - > - </Info> - <Freetext + helpText="Primary DNS Address:" name="wiz_ext_dns1" variableName="wiz_ext_dns1" editable="false" > </Freetext> - <Info - > - </Info> - <Info - helpText="Secondary DNS Address:" - > - </Info> <Freetext + helpText="Secondary DNS Address:" name="wiz_ext_dns2" variableName="wiz_ext_dns2" editable="false" diff --git a/dns_wizard/scripts/Dnsconf.pm b/dns_wizard/scripts/Dnsconf.pm index f789f20c..b73359b5 100644 --- a/dns_wizard/scripts/Dnsconf.pm +++ b/dns_wizard/scripts/Dnsconf.pm @@ -27,6 +27,33 @@ use standalone; my $o = DrakconnectConf->new(); +my $dns1; +my $dns2; + +my $file = "/etc/named.conf"; +open (NEW, "< $file"); +DNS : while (<NEW>) { + $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) = @_; |