From c35158aa7b418f93cff4881b95409fb1c6b6e520 Mon Sep 17 00:00:00 2001 From: schwarze <> Date: Mon, 11 May 2009 22:27:22 +0000 Subject: [PATCH] New variable VERBOSESTATUS (=1 by default). When set to 0, daily(8) won't send mail unless there is something to report. Using feedback from kettenis@ henning@ jmc@ OK sthen@ jmc@ --- src/etc/daily | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/etc/daily b/src/etc/daily index 7fc0bcb9..ede2bf4d 100644 --- a/src/etc/daily +++ b/src/etc/daily @@ -1,5 +1,5 @@ # -# $OpenBSD: daily,v 1.59 2009/05/10 19:27:25 schwarze Exp $ +# $OpenBSD: daily,v 1.60 2009/05/11 22:27:22 schwarze Exp $ # From: @(#)daily 8.2 (Berkeley) 1/25/94 # umask 022 @@ -11,10 +11,6 @@ MAINOUT=/var/log/daily.out install -o 0 -g 0 -m 600 /dev/null $PARTOUT install -o 0 -g 0 -m 600 -b /dev/null $MAINOUT -exec > $MAINOUT 2>&1 -sysctl -n kern.version -uptime - start_part() { TITLE=$1 exec > $PARTOUT 2>&1 @@ -110,12 +106,17 @@ next_part "Backing up root filesystem:" } } -next_part "Checking subsystem status:" -echo "" -echo "disks:" -df -kl -echo "" -dump W +next_part "Checking system status:" +if [ "X$VERBOSESTATUS" != X0 ]; then + sysctl -n kern.version + uptime + + echo "" + echo "disks:" + df -kl + echo "" + dump W +fi # The first two regular expressions handle sendmail, the third postfix. # When the queue is empty, exim -bp keeps silent. @@ -125,12 +126,14 @@ mailq | grep -v -e "^/var/spool/mqueue is empty$" \ -e "^Mail queue is empty$" next_part "network:" -netstat -ivn +if [ "X$VERBOSESTATUS" != X0 ]; then + netstat -ivn -t=/var/rwho/* -if [ "$t" != '/var/rwho/*' ]; then - echo "" - ruptime + t=/var/rwho/* + if [ "$t" != '/var/rwho/*' ]; then + echo "" + ruptime + fi fi next_part "Running calendar in the background:"