From 8d11367e7dd2e71a0868b819c636c8cdee78bed5 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Thu, 13 Jan 2022 18:46:14 -0500 Subject: [PATCH] email root instead of user. tends to work better --- sysd-mail-once | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 -- 2.30.2