Subject: Re: Converting Sun-style automount maps to amd format?
To: Grey Wolf <greywolf@captech.com>
From: Matthieu Herrb <matthieu@laas.fr>
List: current-users
Date: 12/04/1999 15:11:11
You wrote (in your message from Friday 3)
 > Does anyone have or know where I can find utilities to convert Sun-style
 > automount maps to amd-style maps?

I use a variant of the following perl script on our auto.home
map. It tries to do some 'factorization' of the mount points, which
may not be appropriate if you have exported directory with only one
element in the path, but this can be fixed.

--- Cut here ---
#!/usr/local/bin/perl

print "/defaults opts:=rw,resvport,vers=2,proto=udp,nosuid,nodev,noconn\n";

open(TABLE, "ypcat $1|") || die "Can't run ypcat";
while (<TABLE>) {
    chop;
    if (m|^([\w-]+)\s+([\w-]+)(,[\w-]+)*:([\w\/\-]+)/([\w&]+)$|) {
        $u = $1;
        $srv = $2;
        $dir = $4;
	$link = $5;
	$link = $u if ( $link = "&");
	print "$u\ttype:=nfs;rhost:=$srv;rfs:=$dir;sublink:=$link\n";
    } else {
	print STDERR "problem with  entry '$_'\n";
    }
}
close TABLE;

exit 0;
--- cut here ---
-- 
					Matthieu