X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=sysd-mail-once;h=c5cd8c84670c257448e19e6ec9b73b58f6a1c8f3;hb=bc712f26afdccd6ecea609edc3705ae719c55b8d;hp=b1a67b881cee88388d64ff0e31cda81d24de96f7;hpb=d35a89dea7c157ba4afa3a541c313a95c1c2bacd;p=log-quiet diff --git a/sysd-mail-once b/sysd-mail-once index b1a67b8..c5cd8c8 100755 --- a/sysd-mail-once +++ b/sysd-mail-once @@ -18,13 +18,19 @@ set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR errors=3 -cbase=$HOME/sysd-mail-once-state +tmp=(~) +cbase="${tmp[0]}/sysd-mail-once-state" to=root -case "$1" in - -h|--help) - cat <>$file + fi fi fi else file=${c}1 - printf "%s\n" "$cursor" >$file + if $dryrun; then + printf "dryrun: creating $file, contents: %s\n" "$cursor" + else + printf "%s\n" "$cursor" >$file + fi if (( errors == 1 )); then send_mail=true fi fi if $send_mail; then - exim -odf -t <= $errors errors." + mi exim -odf -t <