From: Ian Kelling Date: Thu, 13 Jan 2022 23:46:14 +0000 (-0500) Subject: email root instead of user. tends to work better X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=8d11367e7dd2e71a0868b819c636c8cdee78bed5;p=log-quiet email root instead of user. tends to work better --- diff --git a/sysd-mail-once b/sysd-mail-once index 711479c..4ccc81c 100755 --- a/sysd-mail-once +++ b/sysd-mail-once @@ -48,7 +48,6 @@ c=$cbase/$service # c for command file path base glob="$c[0-9]*" arr=($glob); file="${arr[0]}"; [[ $glob != "$file" ]] || file= -u=${USER:-root} [[ -d $cbase ]] || mkdir -p $cbase if [[ ! $file ]]; then @@ -78,13 +77,13 @@ if (( code )); then fi if $send_mail; then journalctl -u $service.service --after-cursor=$(<$file) | \ - mail -s "$HOSTNAME: $service exit code: $code" $u@localhost + mail -s "$HOSTNAME: $service exit code: $code" root fi else if [[ $file ]]; then rm -f $file if [[ $file == $c$errors ]]; then - echo | mail -s "$HOSTNAME: $service success" $u@localhost + echo | mail -s "$HOSTNAME: $service success" root fi fi fi