diff options
-rw-r--r-- | pxe_wizard/Pxe.pm | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/pxe_wizard/Pxe.pm b/pxe_wizard/Pxe.pm index 0f2b7c20..3316be0e 100644 --- a/pxe_wizard/Pxe.pm +++ b/pxe_wizard/Pxe.pm @@ -47,9 +47,11 @@ 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 $IPSERVER = $wiz->{net}->itf_get("IPADDR"); +if (!$IPSERVER) { + my $interface = 'eth0'; + ($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_(`dnsdomainname`); @@ -112,7 +114,7 @@ $o->{pages} = { }, post => sub { -f "$X86/drakwizard_pxe" or return 'error_needpxe'; -# @list_menu or return 'addimgrdz' ; + @list_menu or return 'needimg' ; if ($o->{var}{wiz_level} == 2) { return 'addimg' } elsif ($o->{var}{wiz_level} == 3) { @@ -194,6 +196,14 @@ $o->{pages} = { name => N("Please provide a bootable image..."), next => 'addimg', }, + needimg => { + name => N("Need an image. Please add one."), + no_back => 1, + next => 'welcome', + post => sub { + $o->{var}{wiz_level} = 5 + }, + }, error_imgrdz => { name => N("Please provide a bootable image..."), next => 'addimgrdz', @@ -212,6 +222,7 @@ $o->{pages} = { }, error_needpxe => { name => N("To add/remove/modify PXE boot image, you need to run 'Set PXE server' before."), + no_back => 1, next => 'pxeserver', }, simmilar_entry => { @@ -424,8 +435,8 @@ sub add_img { sub add_imgrdz { my ($SIMG, $VM, $PXENAME) = @_; !member($SIMG, "tfptboot") or return 'error_path_img'; + cp_af($VM, "$IMGPATH/" . basename($VM) . "-$PXENAME"); cp_af($SIMG, "$IMGPATH/$PXENAME.rdz"); - cp_af($VM, "$IMGPATH/$VM-$PXENAME"); } |