What I use here (Thanks to Pat) is set the computer name to it's DNS
name. From my site\config.pl
# Enable maximum warnings and disallow sloppy constructs.
use warnings;
use strict;
use Socket;
use Net::hostent;
$u->{'UserData'}->{'ComputerName'} =
sub {
my $addr = $u->{'_meta'}->{'ipaddr'};
defined $addr
or return undef;
#my $host = gethostbyaddr(inet_aton ($addr),AF_INET);
my $host = gethostbyaddr(inet_aton ($addr));
if (!defined $host) {
warn "Unable to gethostbyaddr ($addr): $? $^E\n";
return undef;
}
my $name = $host->name ();
# Strip off domain portion
$name =~ s/\.(.*)//;
return $name;
};
On Tue, Oct 26, 2004 at 11:59:43AM +0100, Kevin Lawry wrote:
> I am happily building machines matching their computer name to their MAC
> address in the hardware.csv - but I have to pre-populate it
>
> The lazy part of me would like that to be at least semi automatic, if the
> MAC is not on the list the build prompts for a machine name, as it should.
> What I would like is for the machine to then update the hardware.csv file
> for me so that next time I build it it will automatically know its name.
>
> I would think that config.pl might be the place to make the code change
> since this will be a site specific change, but my PERL is not really up to
> it. I am just throwing the idea out incase someone with better coding
> skills than me also thinks its a good idea & feels like making the changes
>
> All the best
>
> Kevin Lawry
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> unattended-info mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/unattended-info
--
Paul Griffith | York University, Dept. of Computer Science & Engineering
CSE Technical Team| 4700 Keele Street, Toronto, Ontario, Canada M3J 1P3
[EMAIL PROTECTED] | CSEB 1003A | Phone: 416-736-2100 x70258 | Fax: 416-736-5872
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info