X-Git-Url: https://iankelling.org/git/?p=log-quiet;a=blobdiff_plain;f=sysd-mail-once;fp=sysd-mail-once;h=4ccc81c3f37ba1a4ae2554818c2b7f7075de1895;hp=711479c84b1dbecdeefbfa76b64122eaeb09467a;hb=8d11367e7dd2e71a0868b819c636c8cdee78bed5;hpb=84cffb3bd9ae61b32f9922bfb5ab038834048a8e 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