mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-24 15:38:26 +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`::
|
`noNotifyWarn`::
|
||||||
Disable notification at start of shutdown warning period
|
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`::
|
`logdir`::
|
||||||
Specifies where to store log files
|
Specifies where to store log files
|
||||||
|
|
||||||
|
|||||||
@ -580,6 +580,7 @@ function notifyOverride(){
|
|||||||
function notify(){
|
function notify(){
|
||||||
if [[ -n "$1" && "$1" != "-" ]]; then
|
if [[ -n "$1" && "$1" != "-" ]]; then
|
||||||
local msg
|
local msg
|
||||||
|
local notifymsg="$1"
|
||||||
msg="${notifyTemplate:-Message from instance \`{instance\}\` on server \`{server\}\`: {msg\}}"
|
msg="${notifyTemplate:-Message from instance \`{instance\}\` on server \`{server\}\`: {msg\}}"
|
||||||
msg="${msg//\{msg\}/${1}}"
|
msg="${msg//\{msg\}/${1}}"
|
||||||
msg="${msg//\{instance\}/${instance}}"
|
msg="${msg//\{instance\}/${instance}}"
|
||||||
@ -592,6 +593,10 @@ function notify(){
|
|||||||
|
|
||||||
notifyDiscord "$msg"
|
notifyDiscord "$msg"
|
||||||
notifyOverride "$msg"
|
notifyOverride "$msg"
|
||||||
|
|
||||||
|
if [ -n "${notifyCommand}" ]; then
|
||||||
|
eval " ${notifyCommand}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@ msgWarnCancelled="Restart cancelled by player request"
|
|||||||
# notifyMsgServerTerminated="Server exited - restarting"
|
# notifyMsgServerTerminated="Server exited - restarting"
|
||||||
# notifyTemplate="Message from instance {instance} on server {server}: {msg}"
|
# notifyTemplate="Message from instance {instance} on server {server}: {msg}"
|
||||||
# noNotifyWarning=true
|
# noNotifyWarning=true
|
||||||
|
# notifyCommand='echo "$msg" | mailx -s "Message from instance ${instance} on server ${HOSTNAME}" "email@domain.com"'
|
||||||
|
|
||||||
# Restart cancel chat command
|
# Restart cancel chat command
|
||||||
#chatCommandRestartCancel="/cancelupdate"
|
#chatCommandRestartCancel="/cancelupdate"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user