diff options
author | dm <dm@cvs.openbsd.org> | 1996-03-02 03:01:50 +0000 |
---|---|---|
committer | dm <dm@cvs.openbsd.org> | 1996-03-02 03:01:50 +0000 |
commit | 1bbdd14bf7171a908ef69a509294f1916eb46e20 (patch) | |
tree | ad138be58ac7df3fd9b8ec46b553c6a4f4ba74ed /usr.sbin/ypserv/ypinit/Makefile.yp | |
parent | b01aa3aca07057b14071da6d0ee38ddbf498045d (diff) |
Added in stuff from 960121. Fixed several bugs in ypxfr.
Diffstat (limited to 'usr.sbin/ypserv/ypinit/Makefile.yp')
-rw-r--r-- | usr.sbin/ypserv/ypinit/Makefile.yp | 71 |
1 files changed, 56 insertions, 15 deletions
diff --git a/usr.sbin/ypserv/ypinit/Makefile.yp b/usr.sbin/ypserv/ypinit/Makefile.yp index 0e0f521989e..7870a2f69c3 100644 --- a/usr.sbin/ypserv/ypinit/Makefile.yp +++ b/usr.sbin/ypserv/ypinit/Makefile.yp @@ -1,5 +1,5 @@ # from: @(#)Makefile 5.6.1.2 (Berkeley) 5/8/91 -# $Id: Makefile.yp,v 1.3 1996/01/06 11:39:40 deraadt Exp $ +# $Id: Makefile.yp,v 1.4 1996/03/02 03:01:40 dm Exp $ YPDBDIR=/var/yp DIR=/etc @@ -12,10 +12,13 @@ ECHO=/bin/echo MAKEDBM=/usr/sbin/makedbm SED=/usr/bin/sed STDHOSTS=/usr/sbin/stdhosts +STDETHERS=/usr/sbin/stdethers +MKNETID=/usr/sbin/mknetid TOUCH=/usr/bin/touch -YPPUSH=$(ECHO) "YPPUSH Not Yet Implemented: " +DOMAIN="`/usr/bin/basename ${.CURDIR}`" +YPPUSH=/usr/sbin/yppush -all: passwd group hosts networks rpc services protocols +all: passwd group hosts ethers networks rpc services protocols netid passwd.time: $(DIR)/master.passwd -@if [ -f $(>) ]; then \ @@ -28,8 +31,8 @@ passwd.time: $(DIR)/master.passwd $(TOUCH) $(@); \ $(ECHO) "updated passwd"; \ if [ ! $(NOPUSH) ]; then \ - $(YPPUSH) passwd.byname; \ - $(YPPUSH) passwd.byuid; \ + $(YPPUSH) -d $(DOMAIN) passwd.byname; \ + $(YPPUSH) -d $(DOMAIN) passwd.byuid; \ $(ECHO) "pushed passwd"; \ else \ : ; \ @@ -50,8 +53,8 @@ group.time: $(DIR)/group $(TOUCH) $(@); \ $(ECHO) "updated group"; \ if [ ! $(NOPUSH) ]; then \ - $(YPPUSH) group.byname; \ - $(YPPUSH) group.bygid; \ + $(YPPUSH) -d $(DOMAIN) group.byname; \ + $(YPPUSH) -d $(DOMAIN) group.bygid; \ $(ECHO) "pushed group"; \ else \ : ; \ @@ -71,8 +74,29 @@ hosts.time: $(DIR)/hosts $(TOUCH) $(@); \ $(ECHO) "updated hosts"; \ if [ ! $(NOPUSH) ]; then \ - $(YPPUSH) hosts.byname; \ - $(YPPUSH) hosts.byaddr; \ + $(YPPUSH) -d $(DOMAIN) hosts.byname; \ + $(YPPUSH) -d $(DOMAIN) hosts.byaddr; \ + $(ECHO) "pushed hosts"; \ + else \ + : ; \ + fi \ + else \ + $(ECHO) "couldn't find $(>)"; \ + fi + +ethers.time: $(DIR)/ethers + -@if [ -f $(DIR)/ethers ]; then \ + $(STDETHERS) $(>) | $(SED) -e s/#.*$$// | \ + $(AWK) 'BEGIN { FS="\t"; OFS="\t"; } { print $$1, $$0 }' | \ + $(MAKEDBM) - ethers.byaddr; \ + $(STDETHERS) $(>) | \ + $(AWK) 'BEGIN { FS="\t"; OFS="\t"; } { print $$2, $$0 }' | \ + $(MAKEDBM) - ethers.byname; \ + $(TOUCH) $(@); \ + $(ECHO) "updated ethers"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) -d $(DOMAIN) ethers.byaddr; \ + $(YPPUSH) -d $(DOMAIN) ethers.byname; \ $(ECHO) "pushed hosts"; \ else \ : ; \ @@ -91,8 +115,8 @@ networks.time: $(DIR)/networks $(TOUCH) $(@); \ $(ECHO) "updated networks"; \ if [ ! $(NOPUSH) ]; then \ - $(YPPUSH) networks.byname; \ - $(YPPUSH) networks.byaddr; \ + $(YPPUSH) -d $(DOMAIN) networks.byname; \ + $(YPPUSH) -d $(DOMAIN) networks.byaddr; \ $(ECHO) "pushed networks"; \ else \ : ; \ @@ -108,7 +132,7 @@ rpc.time: $(DIR)/rpc $(TOUCH) $(@); \ $(ECHO) "updated rpc"; \ if [ ! $(NOPUSH) ]; then \ - $(YPPUSH) rpc.bynumber; \ + $(YPPUSH) -d $(DOMAIN) rpc.bynumber; \ $(ECHO) "pushed rpc"; \ else \ : ; \ @@ -125,7 +149,7 @@ services.time: $(DIR)/services $(TOUCH) $(@); \ $(ECHO) "updated services"; \ if [ ! $(NOPUSH) ]; then \ - $(YPPUSH) services.byname; \ + $(YPPUSH) -d $(DOMAIN) services.byname; \ $(ECHO) "pushed services"; \ else \ : ; \ @@ -145,8 +169,8 @@ protocols.time: $(DIR)/protocols $(TOUCH) $(@); \ $(ECHO) "updated protocols"; \ if [ ! $(NOPUSH) ]; then \ - $(YPPUSH) protocols.bynumber; \ - $(YPPUSH) protocols.byname; \ + $(YPPUSH) -d $(DOMAIN) protocols.bynumber; \ + $(YPPUSH) -d $(DOMAIN) protocols.byname; \ $(ECHO) "pushed protocols"; \ else \ : ; \ @@ -156,17 +180,34 @@ protocols.time: $(DIR)/protocols fi +netid.time: $(DIR)/passwd $(DIR)/group $(DIR)/hosts $(DIR)/netid + -@$(MKNETID) -q -d $(DOMAIN) -p $(DIR)/passwd -g $(DIR)/group -h $(DIR)/hosts -m $(DIR)/netid | \ + $(MAKEDBM) - netid.byname; \ + $(TOUCH) $(@); \ + $(ECHO) "updated netid"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) -d $(DOMAIN) netid.byname; \ + $(ECHO) "pushed netid"; \ + else \ + : ; \ + fi + + passwd: passwd.time group: group.time hosts: hosts.time +ethers: ethers.time networks: networks.time rpc: rpc.time services: services.time protocols: protocols.time +netid: netid.time $(DIR)/passwd: $(DIR)/group: $(DIR)/hosts: +$(DIR)/ethers: $(DIR)/networks: $(DIR)/rpc: $(DIR)/services: $(DIR)/protocols: +$(DIR)/netid: |