Add preliminary support for netgroup.byuser and netgroup.byhosts maps.
(I have to make another pass through here soon; awk doesn't handle lines broken up with '\', which can sometimes appear in netgroup maps.)
This commit is contained in:
parent
ae139d16d7
commit
627b063e66
@ -43,6 +43,7 @@ DBLOAD = /usr/sbin/yp_mkdb -m `hostname`
|
||||
MKNETID = /usr/libexec/mknetid
|
||||
YPPUSH = /usr/bin/yppush
|
||||
DOMAIN = `/bin/domainname`
|
||||
REVNETGROUP = /usr/libexec/revnetgroup
|
||||
|
||||
YPSRCDIR = /etc
|
||||
YPDIR = /var/yp
|
||||
@ -161,7 +162,7 @@ bootparams: $(BOOTPARAMS)
|
||||
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
|
||||
|
||||
|
||||
netgroup: $(NETGROUP)
|
||||
netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser
|
||||
@echo "Updating $@..."
|
||||
$(RM) $@
|
||||
$(CAT) $(NETGROUP) | \
|
||||
@ -173,6 +174,28 @@ netgroup: $(NETGROUP)
|
||||
@$(MAKE) -f ../Makefile netid
|
||||
|
||||
|
||||
netgroup.byhost: $(NETGROUP)
|
||||
@echo "Updating $@..."
|
||||
$(RM) $@
|
||||
$(CAT) $(NETGROUP) | $(REVNETGROUP) -h -f $(NETGROUP) | \
|
||||
$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
|
||||
print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
|
||||
-o $(YPMAPDIR)/$@ - $@
|
||||
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
|
||||
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
|
||||
|
||||
|
||||
netgroup.byuser: $(NETGROUP)
|
||||
@echo "Updating $@..."
|
||||
$(RM) $@
|
||||
$(CAT) $(NETGROUP) | $(REVNETGROUP) -u -f $(NETGROUP) | \
|
||||
$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
|
||||
print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
|
||||
-o $(YPMAPDIR)/$@ - $@
|
||||
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
|
||||
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
|
||||
|
||||
|
||||
hosts.byname: $(HOSTS)
|
||||
@echo "Updating $@..."
|
||||
$(RM) $@
|
||||
|
Loading…
x
Reference in New Issue
Block a user