diff options
author | Antoine Ginies <aginies@mandriva.com> | 2004-01-20 17:06:13 +0000 |
---|---|---|
committer | Antoine Ginies <aginies@mandriva.com> | 2004-01-20 17:06:13 +0000 |
commit | 331d609c186f82e14520d59747e1c6a7273ca5bb (patch) | |
tree | 7400b0e78da6a3d5283e6ebd2485ef045a3410c4 | |
parent | b60510160c33196e5a8a550067d4e7f9e8c1821d (diff) | |
download | drakwizard-331d609c186f82e14520d59747e1c6a7273ca5bb.tar drakwizard-331d609c186f82e14520d59747e1c6a7273ca5bb.tar.gz drakwizard-331d609c186f82e14520d59747e1c6a7273ca5bb.tar.bz2 drakwizard-331d609c186f82e14520d59747e1c6a7273ca5bb.tar.xz drakwizard-331d609c186f82e14520d59747e1c6a7273ca5bb.zip |
- add domainanme test
- now configure /etc/pxe.conf
-rw-r--r-- | pxe_wizard/Pxe.pm | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/pxe_wizard/Pxe.pm b/pxe_wizard/Pxe.pm index 25c0ef2b..a3f6209f 100644 --- a/pxe_wizard/Pxe.pm +++ b/pxe_wizard/Pxe.pm @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # Drakwizard PXE -# release 0.2 +# release 0.3 # Copyright (C) 2004 Mandrakesoft # # Author: Antoine Ginies <aginies _ateuh _ mandrakesoft.com> @@ -42,14 +42,20 @@ my $PXEHELP = $X86 . '/help.txt'; my $PXEMESSAGE = $X86 . '/messages'; my $PXEDEFAULT = $X86 . '/pxelinux.cfg/default'; -my $CONF = '/etc/pxe.conf'; +my $pxeconf = '/etc/pxe.conf'; my $SYSLINUXPATH = '/usr/lib/syslinux/'; my $MEMDISK = $SYSLINUXPATH . '/memdisk'; my $XINETDDIR = "/etc/xinetd.d"; +#my $IPSERVER = $wiz->{net}->itf_get("IPADDR"); +my $interface = 'eth0'; +my ($IPSERVER) = `/sbin/ip addr show dev $interface` =~ /^\s*inet\s+(\d+\.\d+\.\d+\.\d+)/m; +#my $DOMAINNAME = $wiz->{net}->network_get("DOMAINNAME"); +my $DOMAINNAME = chomp_(`domainname`); + my $o = { - name => N("PXE Wizard (devel)"), + name => N("PXE Wizard"), var => { IMG => '/var/install/92/images/network.img', PXENAME => '92', @@ -61,6 +67,12 @@ my $o = { i => '', }, needed_rpm => [ 'pxe', 'tftp-server', 'xinetd' ], + init => sub { + if (member($DOMAINNAME, qw(localdomain (none)))) { + return (0, N("You need to readjust your domainname. For a DNS server you need a correct domainname, not egal to localdomain or none. Launch drakconnect to adjust it.")) + } + 1 + }, }; my %level = ( @@ -454,6 +466,15 @@ EOF } } +sub pxe_conf { + if (!-f "$pxeconf.orig") { cp_af($pxeconf, "$pxeconf.orig") } + substInFile { + s/default_address.*/default_address=$IPSERVER/; + s/mtftp_address.*/mtftp_address=$IPSERVER/; + s/domain.*/domain=$DOMAINNAME/; + } $pxeconf; +} + # set PXE server sub do_it_pxe { return if $::testing; @@ -464,6 +485,7 @@ sub do_it_pxe { default_pxe_menu(); default_pxe_messages(); enable_tftps(); + pxe_conf(); tftp_blksize('N'); map { system("service $_ restart"); $_ } qw(xinetd pxe); undef $w; |