X-Git-Url: https://iankelling.org/git/?p=log-quiet;a=blobdiff_plain;f=sysd-mail-once;fp=sysd-mail-once;h=3542200d12d52b437362d252a3047315d34d0bd7;hp=3b87eea08dbc7c4f399786d4ce5dc4ecaab84adc;hb=8d7f4d77c6eab1163da3dd9bd89c96038cbd158e;hpb=715086df2c8fa349a3ca48ab9dff6d5fc2ad94f0 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 <