iankelling.org
/
git
/
log-quiet
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
84cffb3
)
email root instead of user. tends to work better
author
Ian Kelling
<iank@fsf.org>
Thu, 13 Jan 2022 23:46:14 +0000
(18:46 -0500)
committer
Ian Kelling
<iank@fsf.org>
Thu, 13 Jan 2022 23:46:14 +0000
(18:46 -0500)
sysd-mail-once
patch
|
blob
|
history
diff --git
a/sysd-mail-once
b/sysd-mail-once
index 711479c84b1dbecdeefbfa76b64122eaeb09467a..4ccc81c3f37ba1a4ae2554818c2b7f7075de1895 100755
(executable)
--- 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=
glob="$c[0-9]*"
arr=($glob); file="${arr[0]}"; [[ $glob != "$file" ]] || file=
-u=${USER:-root}
[[ -d $cbase ]] || mkdir -p $cbase
if [[ ! $file ]]; then
[[ -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) | \
fi
if $send_mail; then
journalctl -u $service.service --after-cursor=$(<$file) | \
- mail -s "$HOSTNAME: $service exit code: $code"
$u@localhos
t
+ mail -s "$HOSTNAME: $service exit code: $code"
roo
t
fi
else
if [[ $file ]]; then
rm -f $file
if [[ $file == $c$errors ]]; then
fi
else
if [[ $file ]]; then
rm -f $file
if [[ $file == $c$errors ]]; then
- echo | mail -s "$HOSTNAME: $service success"
$u@localhos
t
+ echo | mail -s "$HOSTNAME: $service success"
roo
t
fi
fi
fi
fi
fi
fi