Initial commit - forked from the corresponding Smartfront repositories.
This commit is contained in:
19
tools/shutdown.d/110-notification-email.sh
Executable file
19
tools/shutdown.d/110-notification-email.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Sends a mail message about shutdown to the Linux user itself.
|
||||
# Hopes the appropriate message forward rule has been set.
|
||||
#
|
||||
# Author: Kovács Zoltán <kovacs.zoltan@smartfront.hu>
|
||||
# License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html)
|
||||
# 2021-09-05 v0.1 Initial release
|
||||
|
||||
MAIL=$(which mail)
|
||||
if [ -n "$MAIL" -a -x "$MAIL" ]; then
|
||||
subject="[Maintenance] A Docker service has been stopped intentionally on $HOSTNAME"
|
||||
message="This is a message from $0 script on $HOSTNAME.\n"
|
||||
message+="This Docker service has been stopped intentionally few seconds ago.\n\n"
|
||||
message+="Best regards: the Maintenance Bot"
|
||||
echo -e "$message" | "$MAIL" -s "$subject" "$USER"
|
||||
fi
|
||||
|
||||
# That's all, Folks!
|
Reference in New Issue
Block a user