Hi.

I am currently going crazy trying to get Automounter to take it's data from LDAP when 
a user logs on.
I have a Perl script written which has been compiled and works fine on one server, but 
if I compile the same script on another server, Automounter does not like it.
We have Perl libraries in different directories on different servers, so I need to be 
able to compile the perl script with perlcc on each different server.

The Perl script is below.  It contacts the LDAP server and returns to STDOUT the 
required data.
The perl script lives in /pkgs/ldapprogs/bin and is called autohome
I then: 'ln -s /pkgs/ldapprogs/bin/autohome /etc/auto_home' and this works fine on one 
of our servers.

#!/pkgs/bin/perl
$username = $ARGV[0];
$LDAPget=`/usr/bin/ldapsearch -h glbldap1 -b ou=Operations,ou=Glebe,o=AAPT 
cn=$username`;
@LDAPfields=split(/\x0a/,$LDAPget);
foreach $value (@LDAPfields) {
if ($value=~/nisMapEntry/) {
($key,$val) = split(/=/,$value);
$val=~ s/&/$username/;
print "$val /home/$username\n";
 }
}


This will output:
server4:/export/home/joakley /home/joakley

Am I on the right track with this script?
I tried installing AMD, but it kept giving errors.

--------------------------
Jason Oakley +612 8282 1434
MSG Security Administrator
AAPT -- Glebe -- Australia
  http://www.aapt.com.au

Windows XP - The most popular $400 solitaire game


Reply via email to