Avoid the output "Running xxx.local" if the "xxx.local" script
does not produce any output. This matches what /etc/security already does with /etc/security.local output.
This commit is contained in:
parent
4d55452261
commit
ed816845e6
11
etc/daily
11
etc/daily
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: daily,v 1.59 2004/04/02 13:13:47 jmmv Exp $
|
||||
# $NetBSD: daily,v 1.60 2004/04/09 17:35:21 kim Exp $
|
||||
# @(#)daily 8.2 (Berkeley) 1/25/94
|
||||
#
|
||||
|
||||
@ -284,7 +284,10 @@ if checkyesno run_skeyaudit; then
|
||||
fi
|
||||
|
||||
if [ -f /etc/daily.local ]; then
|
||||
echo ""
|
||||
echo "Running /etc/daily.local:"
|
||||
. /etc/daily.local
|
||||
. /etc/daily.local > $TMP 2>&1
|
||||
if [ -s $TMP ] ; then
|
||||
printf "\nRunning /etc/daily.local:\n"
|
||||
cat $TMP
|
||||
fi
|
||||
rm -f $TMP
|
||||
fi
|
||||
|
22
etc/monthly
22
etc/monthly
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: monthly,v 1.9 2004/04/02 13:13:47 jmmv Exp $
|
||||
# $NetBSD: monthly,v 1.10 2004/04/09 17:35:21 kim Exp $
|
||||
# from: @(#)monthly 8.1 (Berkeley) 6/9/93
|
||||
#
|
||||
|
||||
@ -19,12 +19,26 @@ echo "To: ${MAILTO:-root}"
|
||||
echo "Subject: $host monthly output for $date"
|
||||
echo ""
|
||||
|
||||
MONTHLYDIR=`mktemp -d /tmp/_monthly.XXXXXX` || 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
|
||||
echo ""
|
||||
echo "Running /etc/monthly.local:"
|
||||
. /etc/monthly.local
|
||||
. /etc/monthly.local > $TMP 2>&1
|
||||
if [ -s $TMP ] ; then
|
||||
printf "\nRunning /etc/monthly.local:\n"
|
||||
cat $TMP
|
||||
fi
|
||||
rm -f $TMP
|
||||
fi
|
||||
|
22
etc/weekly
22
etc/weekly
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: weekly,v 1.18 2004/04/02 13:13:47 jmmv Exp $
|
||||
# $NetBSD: weekly,v 1.19 2004/04/09 17:35:21 kim Exp $
|
||||
# from: @(#)weekly 8.2 (Berkeley) 1/2/94
|
||||
#
|
||||
|
||||
@ -26,6 +26,17 @@ else
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
WEEKLYDIR=`mktemp -d /tmp/_weekly.XXXXXX` || exit 1
|
||||
|
||||
trap "/bin/rm -rf $WEEKLYDIR ; exit 0" EXIT INT QUIT PIPE
|
||||
|
||||
if ! cd "$WEEKLYDIR"; then
|
||||
echo "Can not cd to $WEEKLYDIR".
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TMP=weekly.$$
|
||||
|
||||
#echo ""
|
||||
#echo "Removing old .o files:"
|
||||
#find /usr/src -name '*.o' -atime +21 -print -a -exec rm -f {} \;
|
||||
@ -75,7 +86,10 @@ if checkyesno rebuild_locatedb; then
|
||||
fi
|
||||
|
||||
if [ -f /etc/weekly.local ]; then
|
||||
echo ""
|
||||
echo "Running /etc/weekly.local:"
|
||||
. /etc/weekly.local
|
||||
. /etc/weekly.local > $TMP 2>&1
|
||||
if [ -s $TMP ] ; then
|
||||
printf "\nRunning /etc/weekly.local:\n"
|
||||
cat $TMP
|
||||
fi
|
||||
rm -f $TMP
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user