Fix typos in systemd_failure_notify
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c4816b054b
commit
fbe2eea125
4 changed files with 10 additions and 12 deletions
|
@ -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.¸
|
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:
|
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.
|
You can copy this script to */usr/local/bin* and use create a custom **CONFIG_FILE** as user.
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@ EOF
|
||||||
|
|
||||||
set -e;
|
set -e;
|
||||||
|
|
||||||
SYSTEMD_FAILURE_NOTFY_SERVICE=$1
|
SYSTEMD_FAILURE_NOTIFY_SERVICE=$1
|
||||||
if [ -z "$SYSTEMD_FAILURE_NOTFY_SERVICE" ]; then
|
if [ -z "$SYSTEMD_FAILURE_NOTIFY_SERVICE" ]; then
|
||||||
echo "No service given";
|
echo "No service given";
|
||||||
echo "";
|
echo "";
|
||||||
usage;
|
usage;
|
||||||
|
@ -81,11 +81,11 @@ source_config() {
|
||||||
source_config "$2" "$HOME/.systemd_failure_notify.conf" "/etc/systemd_failure_notify.conf"
|
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"
|
check_requirements "$SYSTEMD_FAILURE_NOTIFY_MAIL_ENABLED" "$SYSTEMD_FAILURE_NOTIFY_GOTIFY_ENABLED"
|
||||||
|
|
||||||
SYSTEMD_FAILURE_NOTFY_HOSTNAME=$(hostname)
|
SYSTEMD_FAILURE_NOTIFY_HOSTNAME=$(hostname)
|
||||||
SYSTEMD_FAILURE_NOTFY_USER=$(whoami)
|
SYSTEMD_FAILURE_NOTIFY_USER=$(whoami)
|
||||||
|
|
||||||
SUBJECT="[systemd $SYSTEMD_FAILURE_NOTFY_HOSTNAME for $SYSTEMD_FAILURE_NOTFY_USER] $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_NOTFY_SERVICE run failed"
|
MESSAGE="$SYSTEMD_FAILURE_NOTIFY_SERVICE run failed"
|
||||||
|
|
||||||
if [[ "${SYSTEMD_FAILURE_NOTIFY_MAIL_ENABLED}" == "true" ]]; then
|
if [[ "${SYSTEMD_FAILURE_NOTIFY_MAIL_ENABLED}" == "true" ]]; then
|
||||||
echo "$MESSAGE"|mailx -Ssendwait -s "$SUBJECT" "$SYSTEMD_FAILURE_NOTIFY_MAIL_ADDRESS";
|
echo "$MESSAGE"|mailx -Ssendwait -s "$SUBJECT" "$SYSTEMD_FAILURE_NOTIFY_MAIL_ADDRESS";
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
.PP
|
.PP
|
||||||
system-helpers - Collection of helper systemd services, systemd timers
|
system-helpers - Collection of helper systemd services, systemd timers
|
||||||
and shell scripts for common configuration.
|
and shell scripts for common configuration.
|
||||||
Designed for use with ArchLinux, although most scripts should work on
|
|
||||||
any distribution.
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.PP
|
.PP
|
||||||
\f[B]system-helpers\f[R] collection provides the following helpers
|
\f[B]system-helpers\f[R] collection provides the following helpers
|
||||||
|
|
|
@ -58,9 +58,9 @@ Set it to \f[B]false\f[R] to use \f[I]gotify\f[R] only.\[ac]
|
||||||
.PP
|
.PP
|
||||||
The following are optional and integrate gotify-cli to send
|
The following are optional and integrate gotify-cli to send
|
||||||
notifications, it defaults to false: -
|
notifications, it defaults to false: -
|
||||||
SYSTEMD_FAILURE_NOTIFY_GOTIFY_ENABLED=\[lq]true\[rq] // `gotify' command
|
\f[B]SYSTEMD_FAILURE_NOTIFY_GOTIFY_ENABLED=\[lq]true\[rq]\f[R] uses
|
||||||
has be available and needs to be properly configured by having a
|
\f[I]gotify\f[R] command which has be available and needs to be properly
|
||||||
cli.json file
|
configured by having a cli.json file.
|
||||||
.PP
|
.PP
|
||||||
You can copy this script to \f[I]/usr/local/bin\f[R] and use create a
|
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.
|
custom \f[B]CONFIG_FILE\f[R] as user.
|
||||||
|
|
Loading…
Reference in a new issue