--- lib/PXElator/pxe.pm 2009/07/31 22:06:47 101 +++ lib/PXElator/pxe.pm 2009/07/31 22:36:06 102 @@ -18,6 +18,18 @@ #$url = "tftp://$server::ip/"; # fallback to tftp #$url = "http://$server::ip/pxelator/"; +use LWP::Simple qw/mirror RC_NOT_MODIFIED/; +foreach my $file ( 'vmlinuz1', 'initrd1.img', 'debian-live-501-i386-rescue.squashfs' ) { + my $path = "$tftpd::dir/debian-live"; + mkdir $path unless -e $path; +# next if -e "$path/$file"; + print STDERR "mirror $file "; + mirror( "http://cdimage.debian.org/cdimage/release/current-live/i386/web/$file", "$path/$file") + == RC_NOT_MODIFIED + && warn("not modified\n") + || warn("mirrored ", -s "$path/$file", "\n") + ; +} sub config_for_ip {