[comp.sys.hp] automount map --> vhe_list map converter

lindner@cs.umn.edu (Paul Lindner) (01/07/91)

This one is for all of you who have HP's running as clients on a sun
network.  I've modified the YP Makefile on the sun so that it automatically
translates changes to the auto.direct file into the vhe_list map

Put this section of code in your makefile (Make sure the leading spaces
are TABS, not spaces.)

vhe_list.time: $(DIR)/auto.direct
        @(while read L; do echo $$L; done < $(DIR)/auto.direct $(CHKPIPE)) | \
                (sed -e "/^#/d" -e s/#.*$$// -e "/^ *$$/d" $(CHKPIPE)) | \
                (awk 'BEGIN { OFS="\t";} {print NR,$$3,$$1,$$2}' $(CHKPIPE)) | \
		(sed "s/:/ /" $(CHKPIPE)) | \
                (sed "s/-//" $(CHKPIPE)) | \
                $(MAKEDBM) - $(YPDBDIR)/$(DOM)/vhe_list;
        @touch vhe_list.time
        @echo "updated vhe_list"
        @if [ ! $(NOPUSH) ]; then $(YPPUSH) vhe_list; fi
        @if [ ! $(NOPUSH) ]; then echo "pushed vhe_list"; fi

vhe_list: vhe_list.time


You'll also have to add vhe_list to the "all:" section in the Makefile.

Now if they only provided a real automounter instead of this "fake"
thing that essentially just mounts from a YP map.  Sigh........

-- 
Paul Lindner, Univ. of MN   \ Microcomputer /  Pauls Law: You can't
IT Sun dude, & UofM ACM pres \ Workstation / fall off the floor.
lindner@boombox.micro.umn.edu \ Networks  / {...!rutgers!umn-cs!lindner}
     |   |  |  |  | | | | |||||\ Center  /||||| | | | |  |  |  |   |