diff options
author | Florent Villard <warly@mandriva.com> | 2003-10-20 10:51:59 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2003-10-20 10:51:59 +0000 |
commit | 306951e28791b261f894a8b71255b4c45d105661 (patch) | |
tree | 9fa88f156c8a6fa200986dc52b42ab43047e81f6 /dns_wizard | |
parent | eacbbd06a147d56f4edfaf008cc667b55577b3be (diff) | |
download | drakwizard-306951e28791b261f894a8b71255b4c45d105661.tar drakwizard-306951e28791b261f894a8b71255b4c45d105661.tar.gz drakwizard-306951e28791b261f894a8b71255b4c45d105661.tar.bz2 drakwizard-306951e28791b261f894a8b71255b4c45d105661.tar.xz drakwizard-306951e28791b261f894a8b71255b4c45d105661.zip |
change copyright
remove old xml related files
Diffstat (limited to 'dns_wizard')
-rw-r--r-- | dns_wizard/dns.wiz | 288 | ||||
-rw-r--r-- | dns_wizard/scripts/Dnsconf.pm | 174 |
2 files changed, 0 insertions, 462 deletions
diff --git a/dns_wizard/dns.wiz b/dns_wizard/dns.wiz deleted file mode 100644 index b4a0b3ef..00000000 --- a/dns_wizard/dns.wiz +++ /dev/null @@ -1,288 +0,0 @@ -<?xml version="1.0"?> - - -<Wizard - name="general" - libScript="__WIZ_HOME__/common/scripts/functions.sh" - wizardTitle="DNS Wizard (configuration)" - imagePosition="top" - defaultImage="__WIZ_HOME__/dns_wizard/images/DNS.png" - perlModule="__WIZ_HOME__/dns_wizard/scripts/Dnsconf.pm" - rpm="bind" -> - - <Variable - name="wiz_ext_dns1" - shellVariable="wiz_ext_dns1" - valueIsTranslated="false" - > - </Variable> - - <Variable - name="wiz_ext_dns2" - shellVariable="wiz_ext_dns2" - valueIsTranslated="false" - > - </Variable> - - <Page - name="Welcome" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-dns.html" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - <Info - helpText="DNS Configuration Wizard" - > - </Info> - - - <Info - helpText="DNS (Domain Name Server) is the service that maps an IP address of a machine with an internet host name." - > - </Info> - - - <Info - helpText="This wizard will help you configuring the DNS services of your server. This configuration will provide a local DNS service for local computers names, with non-local requests forwarded to an outside DNS." - > - </Info> - </Page> - - <Page - name="DNS" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-dns.html" - jumpScript="__WIZ_HOME__/dns_wizard/scripts/check_ext_dns.sh" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - - <Target - targetName="doit" - jumpIndex="10" - > - </Target> - - <Target - targetName="Error" - jumpIndex="1" - > - </Target> - - <Target - targetName="warning" - jumpIndex="2" - > - </Target> - - <Info - helpText="DNS Server Addresses" - > - </Info> - - - <Info - helpText="DNS will allow your network to communicate with the Internet using standard internet host names. In order to configure DNS, you must provide the IP address of primary and secondary DNS server; usually this address are given by your Internet provider." - > - </Info> - - <Freetext - name="wiz_ext_dns1" - variableName="wiz_ext_dns1" - helpText="Primary DNS Address:" - fillfunc="get_dns1" - editable="true" - > - </Freetext> - - <Freetext - name="wiz_ext_dns2" - variableName="wiz_ext_dns2" - helpText="Secondary DNS Address:" - fillfunc="get_dns2" - editable="true" - > - </Freetext> - - <Info - helpText="IP addresses are a dotted list of four numbers smaller than 256." - > - </Info> - </Page> - - <Page - name="warning" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-dns.html" - jumpPage="doit" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - - <Info - helpText="Warning:" - > - </Info> - - - - <Info - helpText="You have entered an empty address for the DNS server." - > - </Info> - - <Info - helpText="Your setting could be accepted, but you will not be able to identify machine names outside your local network." - > - </Info> - - <Info - helpText="Press next to leave these values empty, or back to enter a value." - > - </Info> - </Page> - - <Page - name="Error" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-dns.html" - jumpPage="DNS" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - - - <Info - helpText="This is not a valid address... press next to continue" - > - </Info> - - </Page> - - <Page - name="server launcher" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-dns.html" - jumpPage="DNS" - executionLevel="DEBUG" - nextFinish="false" - canBack="true" - canCancel="true" - > - </Page> - - <Page - name="doit" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-dns.html" - func="do_it" - nextButtonText="Configure" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - - <Target - targetName="done" - jumpIndex="10" - > - </Target> - - <Target - targetName="system_error" - jumpIndex="1" - > - </Target> - - <Info - helpText="Configuring the DNS Server" - > - </Info> - - - <Info - helpText="The wizard collected the following parameters -needed to configure your DNS service:" - > - </Info> - - <Freetext - helpText="Primary DNS Address:" - name="wiz_ext_dns1" - variableName="wiz_ext_dns1" - editable="false" - > - </Freetext> - <Freetext - helpText="Secondary DNS Address:" - name="wiz_ext_dns2" - variableName="wiz_ext_dns2" - editable="false" - > - </Freetext> - - <Info - helpText="To accept these values, and configure your server, click the Next button or use the Back button to correct them." - > - </Info> - </Page> - - <Page - name="done" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-dns.html" - nextButtonText="Quit" - executionLevel="NORMAL" - nextFinish="true" - canBack="false" - canCancel="false" - > - - <Info - helpText="Congratulations" - > - </Info> - - - <Info - helpText="The wizard successfully configured the DNS services of your server." - > - </Info> - </Page> - - <Page - name="error_need_root" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-dns.html" - nextButtonText="OK" - executionLevel="NORMAL" - nextFinish="true" - canBack="false" - canCancel="true" - > - - <Info - helpText="You need to be root to run this wizard" - > - </Info> - </Page> - - <Page - name="system_error" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-dns.html" - nextButtonText="OK" - executionLevel="NORMAL" - nextFinish="true" - canBack="false" - canCancel="true" - > - - <Info - helpText="System error, no configuration done" - > - </Info> - </Page> -</Wizard> diff --git a/dns_wizard/scripts/Dnsconf.pm b/dns_wizard/scripts/Dnsconf.pm deleted file mode 100644 index 4b8b66b0..00000000 --- a/dns_wizard/scripts/Dnsconf.pm +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/perl - -# DNS Config Parser - -# Copyright (C) 2002 MandrakeSoft Arnaud Desmons <adesmons@mandrakesoft.com> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -package Dnsconf; -require "__WIZ_HOME__/common/scripts/Vareqval.pm"; -require "__WIZ_HOME__/common/scripts/IFCFG.pm"; -use MDK::Common; -use strict; -use standalone; - -my $o = IFCFG->new(); - -my $dns1; -my $dns2; - -sub get_root { - my $file = "/etc/sysconfig/named"; - if (-f $file) { - my %mdk = Vareqval->get($file); - return $mdk{ROOTDIR}; - } - ""; -} - -my $file = "/etc/named.conf"; -if (-f $file) { - 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) = @_; - - my (undef, undef, undef, $mday, $mon, $year) = gmtime(time); - $year += 1900; - my $serial_nbm = sprintf "%4dY%2dm%2d00", $year, $mon, $mday; - output($file, map { - my $line = $_; - if (/^(\s*)(\d*)(\s*;\s*Serial.*)$/) { - my $serial_f = $2; - $serial_f++; - if ($serial_f <= $serial_nbm) { - $serial_f = $serial_nbm; - chomp($serial_f); - $line = "$1$serial_f$3\n"; - } - } - $line; - } cat_($file)); -} - -sub do_it { - my $wiz_ip_server = $o->itf_get("IPADDR"); - my $wiz_domain_name = $o->network_get("DOMAINNAME"); - my $wiz_host_name = $o->network_get("HOSTNAME"); - my $s_trunc = "$1.$2.$3" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; - my $ds = "$4" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; - my $host = "$1" if $wiz_host_name =~ /(.*?)\..*/; - my $reversnet = "$3$2$1" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; - my $file = "/etc/host.conf"; - - MDK::Common::cp_af($file, $file.".orig"); - MDK::Common::cp_af("__WIZ_HOME__/dns_wizard/scripts/host.conf.default", $file); - - $file = "/etc/named.conf"; - -f $file and MDK::Common::cp_af($file, $file.".orig"); - - my $ispns1 = $ENV{wiz_ext_dns1} || "// __ISPN1__"; - my $ispns2 = $ENV{wiz_ext_dns2} || "// __ISPN2__"; - - output($file, map { - s|__ISPNS1__|$ispns1|g; - s|__ISPNS2__|$ispns2|g; - s|__dname__|$wiz_domain_name|g; - s|__revnet__|$reversnet|g; - s|__net__|$s_trunc|g; - $_; - } cat_("__WIZ_HOME__/dns_wizard/scripts/named.conf.default")); - - standalone::explanations("$file : DNS1: $ispns1 DNS2: $ispns2"); -# Bug fix for bind 9: - if (! -f "/etc/rndc.key") { system("touch /etc/rndc.key") or die "can not touch /etc/rndc.key"}; - -# root.hints - $file="/var/named/root.hints"; - -f $file and MDK::Common::cp_af($file, $file . ".orig"); - MDK::Common::cp_af("__WIZ_HOME__/dns_wizard/scripts/root.hints.default", $file); - standalone::explanations("$file clobbered"); -# 127.0.0.rev - $file="/var/named/127.0.0.rev"; - -f $file and MDK::Common::cp_af($file, $file . ".orig"); - output($file, map { - s|__hname__|$wiz_host_name|g; - $_; - } cat_("__WIZ_HOME__/dns_wizard/scripts/127.0.0.rev.default")); - standalone::explanations("$file : hostname: $wiz_host_name"); - up_serial($file); - -# $ipnet.rev - $file = "/var/named/$s_trunc.rev"; - -f $file and MDK::Common::cp_af($file, $file.".orig"); - output($file, map { - s|__dname__|$wiz_domain_name|g; - s|__hname__|$wiz_host_name|g; - s|__revnet__|$reversnet|g; - s|__nb__|$ds|g; - $_; - } cat_("__WIZ_HOME__/dns_wizard/scripts/ipnet.rev.default")); - up_serial($file); - standalone::explanations("$file : domain: $wiz_domain_name hostname: $wiz_host_name revnet: $reversnet -nb: $ds"); -# $domain.db - $file = "/var/named/$wiz_domain_name.db"; - -f $file and MDK::Common::cp_af($file, $file.".orig"); - output($file, map { - s|__dname__|$wiz_domain_name|g; - s|__hname__|$wiz_host_name|g; - s|__ip__|$wiz_ip_server|g; - s|__host__|$host|g; - s|__nb__|$ds|g; - $_; - } cat_("__WIZ_HOME__/dns_wizard/scripts/domain.db.default")); - up_serial($file); - standalone::explanations("$file : domain: $wiz_domain_name hostname: $wiz_host_name revnet: $reversnet -nb: $ds"); -# resolv.conf - $file = "/etc/resolv.conf"; - -f $file and MDK::Common::cp_af($file, $file.".orig"); - open(NEW, "> $file"); - print NEW "domain $wiz_domain_name\n"; - print NEW "nameserver $wiz_ip_server\n"; - standalone::explanations("$file : domain: $wiz_domain_name nameserver: $wiz_ip_server"); - system("/sbin/chkconfig --level 235 named on"); - system("/etc/rc.d/init.d/named restart"); - 10; -} -1; |