summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.yppasswdd/yppwupdate
blob: a209809fd9091512b18ec4cdc7caa058503581f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/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.3 1996/06/05 06:13:09 wpaul Exp $
#

PATH=/bin:/usr/bin; export PATH
LOG=yes
LOGFILE=/var/yp/ypupdate.log

umask 077

if [ ! -f $LOGFILE ];
then
	touch $LOGFILE
	echo "# Edit /usr/libexec/yppwupdate to disable" >> $LOGFILE
	echo "# logging to this file from yppasswdd." >> $LOGFILE
	echo -n "# Log started on: " >> $LOGFILE
	date >> $LOGFILE
fi

if [ ! $LOG ];
then
	cd /var/yp && make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 2>&1
else
	cd /var/yp && make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 >> $LOGFILE 2>&1
fi
OpenPOWER on IntegriCloud