diff options
author | sjg <sjg@FreeBSD.org> | 2013-09-05 20:18:59 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2013-09-05 20:18:59 +0000 |
commit | 62bb1062226d3ce6a2350808256a25508978352d (patch) | |
tree | 22b131dceb13c3df96da594fbaadb693504797c7 /usr.sbin/periodic | |
parent | 72ab90509b3a51ab361bf710338f2ef44a4e360d (diff) | |
parent | 04932445481c2cb89ff69a83b961bdef3d64757e (diff) | |
download | FreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.zip FreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.tar.gz |
Merge from head
Diffstat (limited to 'usr.sbin/periodic')
-rw-r--r-- | usr.sbin/periodic/periodic.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh index cfe6109..c27aeee 100644 --- a/usr.sbin/periodic/periodic.sh +++ b/usr.sbin/periodic/periodic.sh @@ -21,7 +21,7 @@ output_pipe() case "$output" in /*) pipe="cat >>$output";; "") pipe=cat;; - *) pipe="mail -E -s '$host ${1##*/} run output' $output";; + *) pipe="mail -E -s '$host ${2}${2:+ }${1##*/} run output' $output";; esac eval $pipe } @@ -53,12 +53,13 @@ if [ $1 != "LOCKED" ]; then case $? in 0) ;; 73) #EX_CANTCREATE - echo "can't create ${lockfile}" | output_pipe $arg + echo "can't create ${lockfile}" | \ + output_pipe $arg "$PERIODIC" ret=1 ;; 75) #EX_TEMPFAIL echo "$host ${arg##*/} prior run still in progress" | \ - output_pipe $arg + output_pipe $arg "$PERIODIC" ret=1 ;; *) @@ -76,6 +77,8 @@ shift arg=$1 tmp_output=`mktemp ${TMPDIR:-/tmp}/periodic.XXXXXXXXXX` +context="$PERIODIC" +export PERIODIC="$arg${PERIODIC:+ }${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 @@ -135,6 +138,6 @@ esac echo "" echo "-- End of $arg output --" fi -} | output_pipe ${arg} +} | output_pipe $arg "$context" rm -f $tmp_output |