diff options
author | Jeremie Le Hen <jlh@FreeBSD.org> | 2013-09-03 13:40:24 +0000 |
---|---|---|
committer | Jeremie Le Hen <jlh@FreeBSD.org> | 2013-09-03 13:40:24 +0000 |
commit | 94582faa19f390c574195873c808d26288c43d7c (patch) | |
tree | c15b5f2c5e94c186035546c3aea4e9275be9fd56 /usr.sbin/periodic | |
parent | 387eeae2fba28027e52fe8c6d11b60f22562e741 (diff) | |
download | src-test2-94582faa19f390c574195873c808d26288c43d7c.tar.gz src-test2-94582faa19f390c574195873c808d26288c43d7c.zip |
Notes
Diffstat (limited to 'usr.sbin/periodic')
-rw-r--r-- | usr.sbin/periodic/periodic.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh index 9b13a96b652a..c27aeee1d309 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,7 @@ 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 @@ -136,6 +138,6 @@ esac echo "" echo "-- End of $arg output --" fi -} | output_pipe ${arg} +} | output_pipe $arg "$context" rm -f $tmp_output |