From owner-freebsd-hackers Mon Jan 4 08:23:46 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA01945 for freebsd-hackers-outgoing; Mon, 4 Jan 1999 08:23:46 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from mailgate.fore.com (mailgate.fore.com [169.144.68.6]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA01940 for ; Mon, 4 Jan 1999 08:23:44 -0800 (PST) (envelope-from rv@fore.com) Received: from mailman.fore.com (mailman.fore.com [169.144.2.12]) by mailgate.fore.com (8.9.1/8.9.1) with ESMTP id LAA19671; Mon, 4 Jan 1999 11:22:54 -0500 (EST) Received: from sol.eng.fore.com (sol [169.144.155.73]) by mailman.fore.com (8.8.8/8.8.8) with ESMTP id LAA20098; Mon, 4 Jan 1999 11:23:10 -0500 (EST) Received: from agastya.eng.fore.com (agastya [169.144.1.196]) by sol.eng.fore.com (8.8.8/8.8.8) with ESMTP id LAA22670; Mon, 4 Jan 1999 11:22:56 -0500 (EST) Received: from localhost (rv@localhost) by agastya.eng.fore.com (8.9.1b+Sun/8.9.1) with SMTP id LAA00395; Mon, 4 Jan 1999 11:22:55 -0500 (EST) Message-Id: <199901041622.LAA00395@agastya.eng.fore.com> X-Authentication-Warning: agastya.eng.fore.com: rv owned process doing -bs X-Authentication-Warning: agastya.eng.fore.com: rv@localhost didn't use HELO protocol To: Alexander Indenbaum cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Sun automount -> Amd (4.4BSD Automounter) map convertor In-reply-to: Message from Alexander Indenbaum of "Sun, 03 Jan 1999 16:56:29 +0200." Reply-to: rv@fore.com X-Mailer: MH v6.8.3 X-LoopDetect: rv@fore.com Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII Date: Mon, 04 Jan 1999 11:22:55 -0500 From: Rajesh Vaidheeswarran Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -- using MH template repl.format -- In a previous message, Alexander Indenbaum writes: > Hi! > > I'm looking for script which will convert Sun automount map into > Amd (4.4BSD Automounter) map to be used in NIS Makefile. > > Does such tool exist? Yes. rv #!/usr/bin/env 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='fore.com'; # 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 } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message