aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/periodic
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2000-09-19 22:15:00 +0000
committerBrian Somers <brian@FreeBSD.org>2000-09-19 22:15:00 +0000
commitdf470af5f8ea2b5b025e320973d3136ae2d5d877 (patch)
tree4313e4eb728f9092b94dee82ac8767951be418f7 /usr.sbin/periodic
parent8a7f44a640c64d9c603bd9915ea9beda9cf26183 (diff)
downloadsrc-df470af5f8ea2b5b025e320973d3136ae2d5d877.tar.gz
src-df470af5f8ea2b5b025e320973d3136ae2d5d877.zip
Put temporary output in ${TMPDIR:-/tmp}
If $<basedir>_output is not set, don't redirect output PR: 21395
Notes
Notes: svn path=/head/; revision=66084
Diffstat (limited to 'usr.sbin/periodic')
-rw-r--r--usr.sbin/periodic/periodic.89
-rw-r--r--usr.sbin/periodic/periodic.sh5
2 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/periodic/periodic.8 b/usr.sbin/periodic/periodic.8
index 4ab3dec48855..e15ee2cd1010 100644
--- a/usr.sbin/periodic/periodic.8
+++ b/usr.sbin/periodic/periodic.8
@@ -127,14 +127,13 @@ output.
If the
.Va <basedir>_output
value does not begin with a
-.Dq / ,
-it is assumed to contain a list of email addresses, and the output is
-mailed to them.
+.Dq /
+and is not empty, it is assumed to contain a list of email addresses, and
+the output is mailed to them.
.Pp
If
.Va <basedir>_output
-is not set, it defaults to
-.Dq root .
+is not set or is empty, output is sent to standard output.
.Sh ENVIRONMENT
The
.Nm
diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh
index cb849b538ed5..35772efedfd3 100644
--- a/usr.sbin/periodic/periodic.sh
+++ b/usr.sbin/periodic/periodic.sh
@@ -27,7 +27,7 @@ fi
host=`hostname`
export host
-tmp_output=/var/run/periodic.$$
+tmp_output=${TMPDIR:-/tmp}/periodic.$$
# Execute each executable file in the directory list. If the x bit is not
# set, assume the user didn't really want us to muck with it (it's a
@@ -39,7 +39,8 @@ do
eval output=\$${arg##*/}_output
case "$output" in
/*) pipe="cat >>$output";;
- *) pipe="mail -s '$host ${arg##*/} run output' ${output:-root}";;
+ "") pipe=cat
+ *) pipe="mail -s '$host ${arg##*/} run output' $output";;
esac
success=YES info=YES badconfig=NO # Defaults when ${run}_* aren't YES/NO