Hi Matthieu,

it will only work with the linux bootdisk.
DOS doesn't support sockets.


Greetings
Jan 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Matthieu MARC
Sent: Wednesday, June 01, 2005 8:01 AM
To: [email protected]
Subject: [Unattended] Assigning ComputerName dynamicaly


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;



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
unattended-info mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unattended-info

Reply via email to