4 |
use strict; |
use strict; |
5 |
|
|
6 |
use server; |
use server; |
7 |
|
use pxelinux; |
8 |
use File::Slurp; |
use File::Slurp; |
9 |
|
|
10 |
sub shared { |
sub shared { |
19 |
return $value; |
return $value; |
20 |
} |
} |
21 |
|
|
22 |
|
sub debian_live { |
23 |
|
$dhcpd::file = "pxelinux.0"; |
24 |
|
$pxelinux::path_prefix = 'live-helper/tftpboot/'; |
25 |
|
$pxelinux::config_file = 'pxelinux.cfg/default'; |
26 |
|
} |
27 |
|
|
28 |
|
sub webconverger { |
29 |
|
$dhcpd::file = "pxelinux.0"; |
30 |
|
$pxelinux::path_prefix = 'webconverger/'; |
31 |
|
# $pxelinux::config_file = 'default'; |
32 |
|
|
33 |
|
return; # FIXME |
34 |
|
|
35 |
|
my $cfg = "$tftp::dir/pxelinux.cfg"; |
36 |
|
return if -e $cfg; |
37 |
|
|
38 |
|
warn "using iso"; |
39 |
|
# system "mount -t 9660 | grep webc-5.2 || sudo mount /srv/pxelator/iso/webc-5.2.iso /srv/pxelator/tftp/webconverger/iso/ -o loop -t iso9660 -v"; |
40 |
|
|
41 |
|
symlink "/usr/lib/syslinux/pxelinux.0", "$tftp::dir/$dhcpd::file"; |
42 |
|
|
43 |
|
} |
44 |
|
|
45 |
sub for_ip { |
sub for_ip { |
46 |
my $ip = shift; |
my $ip = shift; |
47 |
$tftp::dir = "$server::base_dir/tftp/live-helper/tftpboot"; |
# debian_live(); |
48 |
$dhcpd::file = "pxelinux.0"; |
webconverger(); |
49 |
|
# $tftp::dir = "$server::base_dir/tftp/$pxelinux::path_prefix"; |
50 |
} |
} |
51 |
|
|
52 |
1; |
1; |