[BACK]Return to monthly CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc

File: [cvs.NetBSD.org] / src / etc / monthly (download)

Revision 1.10.10.1, Wed Jun 6 14:58:14 2007 UTC (12 years, 10 months ago) by liamjfoy
Branch: netbsd-4
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0
Changes since 1.10: +2 -2 lines

Pull up following revision(s) (requested by martti in ticket #708):
	etc/monthly: revision 1.11
	etc/weekly: revision 1.23
	etc/security: revision 1.102
	etc/daily: revision 1.70
Use "mktemp -d -t xxx" to create the temporary directories. This will use
TMPDIR environment variable if set, otherwise use /tmp.  (misc/35544)

#!/bin/sh -
#
#	$NetBSD: monthly,v 1.10.10.1 2007/06/06 14:58:14 liamjfoy Exp $
#	from: @(#)monthly	8.1 (Berkeley) 6/9/93
#

export PATH=/bin:/usr/bin:/sbin:/usr/sbin
umask 077

if [ -s /etc/monthly.conf ]; then
	. /etc/monthly.conf
fi

host=`hostname`
date=`date`
rcvar_manpage='monthly.conf(5)'

echo "To: ${MAILTO:-root}"
echo "Subject: $host monthly output for $date"
echo ""

MONTHLYDIR=$(mktemp -d -t _monthly) || exit 1

trap "/bin/rm -rf $MONTHLYDIR ; exit 0" EXIT INT QUIT PIPE

if ! cd "$MONTHLYDIR"; then
	echo "Can not cd to $MONTHLYDIR".
	exit 1
fi

TMP=monthly.$$

# echo ""
# echo "Doing login accounting:"
# ac -p | sort -nr +1

if [ -f /etc/monthly.local ]; then
	. /etc/monthly.local > $TMP 2>&1
	if [ -s $TMP ] ; then
		printf "\nRunning /etc/monthly.local:\n"
		cat $TMP
	fi
	rm -f $TMP
fi