iankelling.org
/
git
/
log-quiet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix sysd-mail-once missing email on 1 error, minor improvements
[log-quiet]
/
sysd-mail-once
diff --git
a/sysd-mail-once
b/sysd-mail-once
index 8feedd377e6324d4d70b5e87f3566495c80fcec9..e53d6ee6e5f41df4df6b78a702e5f3f3ae9e05e9 100755
(executable)
--- a/
sysd-mail-once
+++ b/
sysd-mail-once
@@
-44,7
+44,7
@@
esac
service=$1
shift
service=$1
shift
-c=$cbase/$service
+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=
@@
-76,5
+76,9
@@
else # $@ failed
else
file=${c}1
printf "%s\n" "$cursor" >$file
else
file=${c}1
printf "%s\n" "$cursor" >$file
+ if (( errors == 1 )); then
+ journalctl -u $service.service --after-cursor=$(<$file) | \
+ mail -s "$HOSTNAME: $service failure" $u@localhost
+ fi
fi
fi
fi
fi