From: Ian Kelling Date: Wed, 10 May 2023 17:56:10 +0000 (-0400) Subject: sycam sysd-mail-once: slightly more verbose, plus dry run X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=8d7f4d77c6eab1163da3dd9bd89c96038cbd158e;p=log-quiet sycam sysd-mail-once: slightly more verbose, plus dry run --- diff --git a/sysd-mail-once b/sysd-mail-once index 3b87eea..3542200 100755 --- a/sysd-mail-once +++ b/sysd-mail-once @@ -20,9 +20,11 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR errors=3 cbase=$HOME/sysd-mail-once-state to=root -case "$1" in - -h|--help) - cat <$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 <