xref: /freebsd/usr.sbin/rpc.ypupdated/ypupdate (revision 5c2bc3db201a4fe8d7911cf816bea104d5dc2138)
1#!/bin/sh
2#
3# This script is invoked by rpc.ypupdatedd to propagate NIS maps
4# after the master map databases have been modified. It expects
5# to be passed two arguments: the name of the map that was updated
6# and the name of the domain where the map resides.
7# These are passed to /var/yp/Makefile.
8#
9# Comment out the LOG=yes line to disable logging.
10#
11#
12
13LOG=yes
14LOGFILE=/var/yp/ypupdate.log
15
16umask 077
17
18if [ ! -f $LOGFILE ];
19then
20	/usr/bin/touch $LOGFILE
21	echo "# Edit /usr/libexec/yppwupdate to disable" >> $LOGFILE
22	echo "# logging to this file from yppasswdd." >> $LOGFILE
23	echo -n "# Log started on: " >> $LOGFILE
24	/bin/date >> $LOGFILE
25fi
26
27if [ ! $LOG ];
28then
29	cd /var/yp/$2; /usr/bin/make -f ../Makefile $1 2>&1
30else
31	cd /var/yp/$2; /usr/bin/make -f ../Makefile $1 >> $LOGFILE
32fi
33