Fix typos in systemd_failure_notify
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Alexander Schäferdiek 2023-01-25 19:07:14 +01:00
parent c4816b054b
commit fbe2eea125
4 changed files with 10 additions and 12 deletions

View file

@ -21,7 +21,7 @@ The following are at least required for the script to work:\
By default, **SYSTEMD_FAILURE_NOTIFY_MAIL_ENABLED** is set to **true**. Set it to **false** to use *gotify* only.¸
The following are optional and integrate gotify-cli to send notifications, it defaults to false:
- SYSTEMD_FAILURE_NOTIFY_GOTIFY_ENABLED="true" // 'gotify' command has be available and needs to be properly configured by having a cli.json file
- **SYSTEMD_FAILURE_NOTIFY_GOTIFY_ENABLED="true"** uses *gotify* command which has be available and needs to be properly configured by having a cli.json file.
You can copy this script to */usr/local/bin* and use create a custom **CONFIG_FILE** as user.

View file

@ -13,8 +13,8 @@ EOF
set -e;
SYSTEMD_FAILURE_NOTFY_SERVICE=$1
if [ -z "$SYSTEMD_FAILURE_NOTFY_SERVICE" ]; then
SYSTEMD_FAILURE_NOTIFY_SERVICE=$1
if [ -z "$SYSTEMD_FAILURE_NOTIFY_SERVICE" ]; then
echo "No service given";
echo "";
usage;
@ -81,11 +81,11 @@ source_config() {
source_config "$2" "$HOME/.systemd_failure_notify.conf" "/etc/systemd_failure_notify.conf"
check_requirements "$SYSTEMD_FAILURE_NOTIFY_MAIL_ENABLED" "$SYSTEMD_FAILURE_NOTIFY_GOTIFY_ENABLED"
SYSTEMD_FAILURE_NOTFY_HOSTNAME=$(hostname)
SYSTEMD_FAILURE_NOTFY_USER=$(whoami)
SYSTEMD_FAILURE_NOTIFY_HOSTNAME=$(hostname)
SYSTEMD_FAILURE_NOTIFY_USER=$(whoami)
SUBJECT="[systemd $SYSTEMD_FAILURE_NOTFY_HOSTNAME for $SYSTEMD_FAILURE_NOTFY_USER] $SYSTEMD_FAILURE_NOTFY_SERVICE RUN FAILED"
MESSAGE="$SYSTEMD_FAILURE_NOTFY_SERVICE run failed"
SUBJECT="[systemd $SYSTEMD_FAILURE_NOTIFY_HOSTNAME for $SYSTEMD_FAILURE_NOTIFY_USER] $SYSTEMD_FAILURE_NOTIFY_USER RUN FAILED"
MESSAGE="$SYSTEMD_FAILURE_NOTIFY_SERVICE run failed"
if [[ "${SYSTEMD_FAILURE_NOTIFY_MAIL_ENABLED}" == "true" ]]; then
echo "$MESSAGE"|mailx -Ssendwait -s "$SUBJECT" "$SYSTEMD_FAILURE_NOTIFY_MAIL_ADDRESS";

View file

@ -20,8 +20,6 @@
.PP
system-helpers - Collection of helper systemd services, systemd timers
and shell scripts for common configuration.
Designed for use with ArchLinux, although most scripts should work on
any distribution.
.SH DESCRIPTION
.PP
\f[B]system-helpers\f[R] collection provides the following helpers

View file

@ -58,9 +58,9 @@ Set it to \f[B]false\f[R] to use \f[I]gotify\f[R] only.\[ac]
.PP
The following are optional and integrate gotify-cli to send
notifications, it defaults to false: -
SYSTEMD_FAILURE_NOTIFY_GOTIFY_ENABLED=\[lq]true\[rq] // `gotify' command
has be available and needs to be properly configured by having a
cli.json file
\f[B]SYSTEMD_FAILURE_NOTIFY_GOTIFY_ENABLED=\[lq]true\[rq]\f[R] uses
\f[I]gotify\f[R] command which has be available and needs to be properly
configured by having a cli.json file.
.PP
You can copy this script to \f[I]/usr/local/bin\f[R] and use create a
custom \f[B]CONFIG_FILE\f[R] as user.