Subject: Re: amd
To: None <earle@isolar.Tujunga.CA.US>
From: Matthieu Herrb <matthieu@laas.fr>
List: current-users
Date: 01/21/1996 09:55:49
You wrote (in your message from Fri 19)
 > So we use "automount" with a SunOS machine serving NIS auto.* maps.  Since
 > changing all of them to use "amd" is *not* an option, I would really like
 > to hear from somebody who's cobbled together an "amd" setup to live in an
 > all-automounter world, using NIS automount maps.  

Here's the script I use to periodically remake my amd 'home' map from
a NIS+ map. (just change "niscat" to "ypcat -k" to use it with
NIS). By the way, you could perhaps hack the master NIS Makefile to
produce both the automount format map and the amd format.

#!/usr/local/bin/perl
$domain="your_nis_domain";
$server="your_nis_server";

print "/defaults opts:=resvport,nosuid\n";

open(TABLE, "rsh $server niscat auto_home.org_dir.$domain.|") || die "Can't run niscat";
while (<TABLE>) {
    chop;
    if (m|^([\w-]+)\s+(\w+):([\w\/\-]+)/([\w&]+)$|) {
        $u = $1;
        $srv = $2;
        $dir = $3;
	$link = $4;
	$link = $u if ( $link = "&");
	print "$u\ttype:=nfs;rhost:=$srv;rfs:=$dir;sublink:=$link\n";
    } else {
	print STDERR "pb with '$_'\n";
    }
}
close TABLE;
exit 0;

					Matthieu