freebsd-dev/usr.sbin/rpc.yppasswdd/yppwupdate
Bill Paul 5cab6d3187 Make yppwupdate script redirect stderr to stdout; if we don't do this,
the error messages (if any) from yppush will end up on the system console
instead of the /var/yp/ypupdate.log file.
1996-03-05 15:41:02 +00:00

34 lines
913 B
Bash

#!/bin/sh
#
# This script is invoked by rpc.yppasswdd to update the password
# maps after the master password file has been modified. It expects
# to be passed two arguments: the name of the master.passwd template
# file that was modified by the server, and the name of the domain to
# update. These are passed to /var/yp/Makefile.
#
# Comment out the LOG=yes line to disable logging.
#
# $Id: yppwupdate,v 1.1.1.1 1996/02/12 15:09:01 wpaul Exp $
#
LOG=yes
LOGFILE=/var/yp/ypupdate.log
umask 077
if [ ! -f $LOGFILE ];
then
/usr/bin/touch $LOGFILE
echo "# Edit /usr/libexec/yppwupdate to disable" >> $LOGFILE
echo "# logging to this file from yppasswdd." >> $LOGFILE
echo -n "# Log started on: " >> $LOGFILE
/bin/date >> $LOGFILE
fi
if [ ! $LOG ];
then
cd /var/yp; /usr/bin/make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 2>&1
else
cd /var/yp; /usr/bin/make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 >> $LOGFILE 2>&1
fi