[Midnightbsd-cvs] src: usr.sbin/periodic: Don't send email if the message body is empty.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Apr 27 23:43:59 EDT 2008
Log Message:
-----------
Don't send email if the message body is empty.
Remove X11R6 reference.
Modified Files:
--------------
src/usr.sbin/periodic:
periodic.8 (r1.2 -> r1.3)
periodic.sh (r1.2 -> r1.3)
-------------- next part --------------
Index: periodic.sh
===================================================================
RCS file: /home/cvs/src/usr.sbin/periodic/periodic.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -L usr.sbin/periodic/periodic.sh -L usr.sbin/periodic/periodic.sh -u -r1.2 -r1.3
--- usr.sbin/periodic/periodic.sh
+++ usr.sbin/periodic/periodic.sh
@@ -1,7 +1,7 @@
#!/bin/sh -
#
# $MidnightBSD$
-# $FreeBSD: src/usr.sbin/periodic/periodic.sh,v 1.20 2002/05/14 01:15:35 brian Exp $
+# $FreeBSD: src/usr.sbin/periodic/periodic.sh,v 1.21 2007/06/22 10:04:05 dwmalone Exp $
#
# Run nightly periodic scripts
#
@@ -41,11 +41,11 @@
case "$output" in
/*) pipe="cat >>$output";;
"") pipe=cat;;
- *) pipe="mail -s '$host ${arg##*/} run output' $output";;
+ *) pipe="mail -E -s '$host ${arg##*/} run output' $output";;
esac
- success=YES info=YES badconfig=NO # Defaults when ${run}_* aren't YES/NO
- for var in success info badconfig
+ success=YES info=YES badconfig=NO empty_output=YES # Defaults when ${run}_* aren't YES/NO
+ for var in success info badconfig empty_output
do
case $(eval echo "\$${arg##*/}_show_$var") in
[Yy][Ee][Ss]) eval $var=YES;;
@@ -96,8 +96,11 @@
done
if [ $empty = TRUE ]
then
- [ $processed = 1 ] && plural= || plural=s
- echo "No output from the $processed file$plural processed"
+ if [ $empty_output = TRUE ]
+ then
+ [ $processed = 1 ] && plural= || plural=s
+ echo "No output from the $processed file$plural processed"
+ fi
else
echo ""
echo "-- End of $arg output --"
Index: periodic.8
===================================================================
RCS file: /home/cvs/src/usr.sbin/periodic/periodic.8,v
retrieving revision 1.2
retrieving revision 1.3
diff -L usr.sbin/periodic/periodic.8 -L usr.sbin/periodic/periodic.8 -u -r1.2 -r1.3
--- usr.sbin/periodic/periodic.8
+++ usr.sbin/periodic/periodic.8
@@ -22,10 +22,10 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $MidnightBSD$
-.\" $FreeBSD: src/usr.sbin/periodic/periodic.8,v 1.30 2005/01/18 20:02:40 ru Exp $
+.\" $MIdnightBSD$
+.\" $FreeBSD: src/usr.sbin/periodic/periodic.8,v 1.33 2007/09/07 21:54:45 gabor Exp $
.\"
-.Dd September 7, 2007
+.Dd April 27, 2008
.Os
.Dt PERIODIC 8
.Sh NAME
@@ -49,7 +49,7 @@
This usually occurs early in the morning (local time).
.It Pa weekly
Perform the standard weekly periodic executable run.
-This usually occurs on Saturday mornings.
+This usually occurs very early on Saturday mornings.
.It Pa monthly
Perform the standard monthly periodic executable run.
This usually occurs on the first day of the month.
@@ -136,6 +136,11 @@
.Ql /
and is not empty, it is assumed to contain a list of email addresses, and
the output is mailed to them.
+If
+.Ao Ar basedir Ac Ns Va _show_empty_output
+is set to
+.Dq Li NO ,
+then no mail will be sent if the output was empty.
.Pp
If
.Ao Ar basedir Ac Ns Va _output
@@ -199,7 +204,7 @@
.Va local_periodic
variable reading:
.Pp
-.Dl local_periodic="/usr/local/etc/periodic /usr/X11R6/etc/periodic"
+.Dl local_periodic="/usr/local/etc/periodic"
.Pp
To log
.Nm
More information about the Midnightbsd-cvs
mailing list