]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/rpc.yppasswdd/yppwupdate
zfs: merge openzfs/zfs@233d34e47
[FreeBSD/FreeBSD.git] / usr.sbin / rpc.yppasswdd / yppwupdate
1 #!/bin/sh
2 #
3 # This script is invoked by rpc.yppasswdd to update the password
4 # maps after the master password file has been modified. It expects
5 # to be passed two arguments: the name of the master.passwd template
6 # file that was modified by the server, and the name of the domain to
7 # update. These are passed to /var/yp/Makefile.
8 #
9 # Comment out the LOG=yes line to disable logging.
10 #
11 #
12
13 PATH=/bin:/usr/bin; export PATH
14 LOG=yes
15 LOGFILE=/var/yp/ypupdate.log
16
17 umask 077
18
19 if [ ! -f $LOGFILE ];
20 then
21         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         date >> $LOGFILE
26 fi
27
28 if [ ! $LOG ];
29 then
30         cd /var/yp && make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 2>&1
31 else
32         cd /var/yp && make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 >> $LOGFILE 2>&1
33 fi