Hi everybody,

I have installed unattended on a w2k3 server. I managed to make an installation of a winxp client.

I want to say that it is a great job you have done, really.

Now, I wanted to assign ComputerName dynamicaly. I read the page http://unattended.sourceforge.net/dynamic.php and notice the example.
I put this example in my config.pl file.The problem is that when booting and executing this file, perl do not find socket.pm. Is this module must be installed on the linux-based boot file ?


Thanks for help.
Matthieu MARC

--------------------------------------------------

Assigning ComputerName based on DNS hostname

To automatically set the machine's ComputerName based on the DNS hostname associated with the IP address assigned to the machine:

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));

        if (!defined $host) {
            warn "Unable to gethostbyaddr ($addr): $? $^E\n";
            return undef;
        }

        my $name = $host->name ();
        # Strip off domain portion
        $name =~ s/\.(.*)//;
        return $name;
    };

1;

begin:vcard
fn:MARC Matthieu
n:Matthieu;MARC
org:ENSAM - Centre d'Angers;Service Informatique
adr:;;2 boulevard du ronceray;Angers;FR;49100;France
email;internet:[EMAIL PROTECTED]
title;quoted-printable:Ing=C3=A9nieur d'=C3=A9tude
tel;work:02.41.20.73.61
url:http://www.angers.ensam.fr
version:2.1
end:vcard

Reply via email to