Date: Thu, 15 Feb 1996 15:00:46 -0500 From: "Garrett A. Wollman" <wollman@lcs.mit.edu> To: mikebo@tellabs.com Cc: questions@freebsd.org Subject: Sun automounter -> AMD conversion Message-ID: <9602152000.AA13101@halloran-eldar.lcs.mit.edu> In-Reply-To: <199602151931.NAA09051@sunc210.tellabs.com> References: <199602151931.NAA09051@sunc210.tellabs.com>
next in thread | previous in thread | raw e-mail | index | archive | help
<<On Thu, 15 Feb 1996 13:31:34 -0600 (CST), mikebo@tellabs.com said:
> Has anyone written a script (in perl or whatever) to take standard Sun
> automounter maps and convert them to the bizarre AMD map format? Just
> want to ask before re-inventing the wheel.
There is such a script in the AMD sources, but it is not included in
our version.
------------------------------------
Newsgroups: mail.amd-workers
Organization: NASA Langley Research Center, Hampton VA, USA
Lines: 81
Message-Id: <MIKE.93Jun17115700@tab12.larc.nasa.gov>
References: <receive.740254207.usenet@news.larc.nasa.gov>
Nntp-Posting-Host: tab12.larc.nasa.gov
In-Reply-To: ecb@galileo.res.utc.com's message of 16 Jun 1993 12:44:14 -0400
Comments: Hyperbole mail buttons accepted, v3.06.
Errors-To: owner-amd-workers@acl.lanl.gov
Reply-To: mike@tab00.larc.nasa.gov (Mike Walker)
From: mike@tab00.larc.nasa.gov (Mike Walker)
Sender: <owner-amd-workers@acl.lanl.gov>
Subject: Re: scripts to change automount maps to amd maps
To: amd-workers@acl.lanl.gov
Date: 17 Jun 1993 15:57:00 GMT
Here's something I used here. You will need to do some hand
editing afterwords, but it's a good start...
Mike
++
#!/bin/perl
#
# Convert Sun automount map format to amd format
#
# This program expects maps with the format
#
# dir [ -options ] machine:/path [ # optional comment ]
# ...
#
# and generates an equivalent amd map as follows:
#
# # generated by sun2amd on Fri May 21 9:16:56 1993
#
# /defaults \
# type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
#
# ## optional comment
# ## options: -options
# dir \
# hostd==machine.larc.nasa.gov;type:=link;fs:=/path || \
# domain==larc.nasa.gov;rhost:=machine;rfs:=/path || \
# rhost:=machine.larc.nasa.gov;rfs:=/path
# ...
#
# You should set the DOMAIN and DEFAULT variables to your preferences.
#
# $Id: sun2amd,v 1.4 1993/05/24 21:10:05 mike Exp mike $
#
require "ctime.pl";
# amd domain name (doesn't have to be the DNS domain; isn't overloading great!)
# Should be what you will pass to amd via the -d command-line switch.
$DOMAIN='larc.nasa.gov';
# amd default settings; consult the docs for what you can/should do here.
# Note, in particular, that if your disk mount points follow a common scheme
# you can specify ``rfs:=/common/path/${key}'' and not have to insert that
# line (twice) in every entry below!
$DEFAULTS='type:=nfs;opts:=rw,grpid,nosuid,utimeout=600';
# print comment header and default string
printf "# generated by sun2amd on %s\n", &ctime(time);
printf "/defaults \\\n %s\n\n", $DEFAULTS;
# loop through map
$has_options = 0;
while (<>) {
if (m,^(\w\S*)(\s+\-\w\S*\s+|\s+)(\w[^:]*):(\/\S*)\s*(.*),) {
($dir, $options, $machine, $path, $rest) = ($1, $2, $3, $4, $5);
print "#$rest\n" if ($rest =~ m/\w/);
if ($options =~ m/-/) {
$options =~ s/ //g;
print "## options: $options\n";
$has_options++;
}
print "$dir \\\n";
printf " hostd==%s.%s;type:=link;fs:=%s || \\\n",
$machine, $DOMAIN, $path;
printf " domain==%s;rhost:=%s;rfs:=%s || \\\n",
$DOMAIN, $machine, $path;
printf " rhost:=%s.%s;rfs:=%s\n\n", $machine, $DOMAIN, $path;
}
}
if ($has_options) {
print STDERR <<"OPTION_NOTE";
NOTE: $has_options entries had custom options which you will need to correct by
hand. Search for the string \"## options:\" in the new map to find them.
OPTION_NOTE
}
- --
Mike Walker AS&M Inc/NASA LaRC Voice: +1 804 864 2305 Fax: +1 804 864 6134
------------------------------------
-GAWollman
--
Garrett A. Wollman | Shashish is simple, it's discreet, it's brief. ...
wollman@lcs.mit.edu | Shashish is the bonding of hearts in spite of distance.
Opinions not those of| It is a bond more powerful than absence. We like people
MIT, LCS, ANA, or NSA| who like Shashish. - Claude McKenzie + Florent Vollant
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9602152000.AA13101>
