#!/usr/bin/perl

# List the PXE config for this host

$hostname = $ARGV[0];

$hostout = `host $hostname`;
chomp $hostout;

@hostout2 = split(/ /,$hostout);

$hostip = $hostout2[3];

($a, $b, $c, $d) = split(/\./,$hostip);

$hostiphex = sprintf ("%02X%02X%02X%02X", $a, $b, $c, $d);
$path = '/tftpboot/pxelinux/pxelinux.cfg/' . $hostiphex;

print "$hostip $path\n\n";
system("ls", "-l", $path);
print "\n";
system("cat", $path);