use warnings;
use strict;
+use autodie;
use File::Slurp;
symlink '/usr/lib/syslinux/gpxelinux.0', $path unless -l $path;
warn "file $path ", -s $path;
-my $url = "http://$server::ip/pxelator/debian-live/";
-my $squash = tftpd::path('debian-live/*squashfs');
+my $url = "http://$server::ip/pxelator/";
+$url = "tftp://$server::ip/"; # fallback to tftp
+my $squash = tftpd::path('debian-live/*squashfs');
-my $config = "$ftpd::dir/pxelinux.cfg/default";
+my $config = "$tftpd::dir/pxelinux.cfg/default";
write_file $config, qq{
default linux
label linux
- kernel $url/vmlinuz1
- append initrd=$url/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=$url/$squash
+ kernel $url/debian-live/vmlinuz1
+ append initrd=$url/debian-live/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=http://$server::ip/pxelator/$squash
};