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/scripts | |
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/scripts')
-rw-r--r-- | dns_wizard/scripts/Dnsconf.pm | 27 |
1 files changed, 27 insertions, 0 deletions
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) = @_; |