]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.sbin/rpc.ypupdated/ypupdate
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / usr.sbin / rpc.ypupdated / ypupdate
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 # $FreeBSD$
12 #
13
14 LOG=yes
15 LOGFILE=/var/yp/ypupdate.log
16
17 umask 077
18
19 if [ ! -f $LOGFILE ];
20 then
21         /usr/bin/touch $LOGFILE
22         echo "# Edit /usr/libexec/yppwupdate to disable" >> $LOGFILE
23         echo "# logging to this file from yppasswdd." >> $LOGFILE
24         echo -n "# Log started on: " >> $LOGFILE
25         /bin/date >> $LOGFILE
26 fi
27
28 if [ ! $LOG ];
29 then
30         cd /var/yp/$2; /usr/bin/make -f ../Makefile $1 2>&1
31 else
32         cd /var/yp/$2; /usr/bin/make -f ../Makefile $1 >> $LOGFILE
33 fi