turns printfs back on
[freebsd-src/fkvm-freebsd.git] / usr.sbin / rpc.yppasswdd / yppwupdate
bloba9db8f7e5b6c310a72828ed6899f3d8bb3b40ddf
1 #!/bin/sh
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.
9 # Comment out the LOG=yes line to disable logging.
11 # $FreeBSD$
14 PATH=/bin:/usr/bin; export PATH
15 LOG=yes
16 LOGFILE=/var/yp/ypupdate.log
18 umask 077
20 if [ ! -f $LOGFILE ];
21 then
22 touch $LOGFILE
23 echo "# Edit /usr/libexec/yppwupdate to disable" >> $LOGFILE
24 echo "# logging to this file from yppasswdd." >> $LOGFILE
25 echo -n "# Log started on: " >> $LOGFILE
26 date >> $LOGFILE
29 if [ ! $LOG ];
30 then
31 cd /var/yp && make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 2>&1
32 else
33 cd /var/yp && make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 >> $LOGFILE 2>&1