summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-07-24 10:48:07 +0000
committerpeter <peter@FreeBSD.org>1996-07-24 10:48:07 +0000
commit085e6f78e53ba9f557719749176f4bcb660fe1d2 (patch)
treeebab4ea2c3eeefe15929bbb722ada74687434a79 /usr.sbin
parent16ad55d2abb8c8db4e0c6e68ae925f9205935978 (diff)
downloadFreeBSD-src-085e6f78e53ba9f557719749176f4bcb660fe1d2.zip
FreeBSD-src-085e6f78e53ba9f557719749176f4bcb660fe1d2.tar.gz
Add sample rules for amd.host, mostly from the AMD docs, but tweaked to fit
the FreeBSD Makefile.yp structure by me. This allows you to have a single amd map for all machines in a cluster. In /etc/sysconfig, it would look something like: amdflags="-p -a /net -c 1800 -l syslog /host amd.host"
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ypserv/Makefile.yp28
1 files changed, 26 insertions, 2 deletions
diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp
index 24b1a96..42a3582 100644
--- a/usr.sbin/ypserv/Makefile.yp
+++ b/usr.sbin/ypserv/Makefile.yp
@@ -1,7 +1,7 @@
#
# Makefile for the NIS databases
#
-# $Id: Makefile.yp,v 1.7 1996/06/25 20:28:01 wpaul Exp $
+# $Id: Makefile.yp,v 1.8 1996/07/18 23:48:13 adam Exp $
#
# This Makefile should only be run on the NIS master server of a domain.
# All updated maps will be pushed to all NIS slave servers listed in the
@@ -102,6 +102,7 @@ MASTER = $(MASTER_PASSWD)
YPSERVERS = $(YPDIR)/ypservers # List of all NIS servers for a domain
PUBLICKEY = $(YPSRCDIR)/publickey
NETID = $(YPSRCDIR)/netid
+AMDHOST = $(YPSRCDIR)/amd.host
target:
@$(RM) $(NFILE)
@@ -117,7 +118,8 @@ target:
#
all: master.passwd passwd hosts group networks protocols rpc \
- services servers netid # aliases publickey netgrp ethers bootparam
+ services servers netid # aliases publickey netgrp ethers bootparam \
+ amd.host
ethers: ethers.byname ethers.byaddr
bootparam: bootparams
@@ -485,3 +487,25 @@ master.passwd.byuid: $(MASTER)
@$(DBLOAD) -c
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
+
+amd.host: $(AMDHOST)
+ @echo "Updating $@..."
+ @echo $@.$$$$ > $(NFILE)
+ $(CAT) $(AMDHOST) | \
+ $(AWK) '$$1 !~ "#" { \
+ for (i = 1; i <= NF; i++) \
+ if (i == NF) { \
+ if (substr($$i, length($$i), 1) == "\\") \
+ printf("%s", substr($$i, 1, length($$i) - 1)); \
+ else \
+ printf("%s\n", $$i); \
+ } \
+ else \
+ printf("%s ", $$i); \
+ }' | \
+ $(DBLOAD) -i $(AMDHOST) -o $(YPMAPDIR)/$@ - $(TMP)
+ @$(MV) $(TMP) $@
+ @$(DBLOAD) -c
+ @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
+ @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
+
OpenPOWER on IntegriCloud