mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-11 10:38:27 +00:00
Add notifyCommand
This commit is contained in:
parent
f26ae1e56f
commit
e11cc9952a
@ -617,6 +617,11 @@ The following options can be overridden on a per-instance basis:
|
||||
`noNotifyWarn`::
|
||||
Disable notification at start of shutdown warning period
|
||||
|
||||
`notifyCommand`::
|
||||
Notify command to run. Notify message will be in `${notifymsg}`, and templated message will be in `${msg}`
|
||||
+
|
||||
e.g. `notifyCommand='echo "$msg" | mailx -s "Message from instance ${instance} on server ${HOSTNAME}" "email@domain.com"'`
|
||||
|
||||
`logdir`::
|
||||
Specifies where to store log files
|
||||
|
||||
|
||||
@ -580,6 +580,7 @@ function notifyOverride(){
|
||||
function notify(){
|
||||
if [[ -n "$1" && "$1" != "-" ]]; then
|
||||
local msg
|
||||
local notifymsg="$1"
|
||||
msg="${notifyTemplate:-Message from instance \`{instance\}\` on server \`{server\}\`: {msg\}}"
|
||||
msg="${msg//\{msg\}/${1}}"
|
||||
msg="${msg//\{instance\}/${instance}}"
|
||||
@ -592,6 +593,10 @@ function notify(){
|
||||
|
||||
notifyDiscord "$msg"
|
||||
notifyOverride "$msg"
|
||||
|
||||
if [ -n "${notifyCommand}" ]; then
|
||||
eval " ${notifyCommand}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@ -48,6 +48,7 @@ msgWarnCancelled="Restart cancelled by player request"
|
||||
# notifyMsgServerTerminated="Server exited - restarting"
|
||||
# notifyTemplate="Message from instance {instance} on server {server}: {msg}"
|
||||
# noNotifyWarning=true
|
||||
# notifyCommand='echo "$msg" | mailx -s "Message from instance ${instance} on server ${HOSTNAME}" "email@domain.com"'
|
||||
|
||||
# Restart cancel chat command
|
||||
#chatCommandRestartCancel="/cancelupdate"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user