diff --git a/README.asciidoc b/README.asciidoc index 9aae3e1..4c321dc 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -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 diff --git a/tools/arkmanager b/tools/arkmanager index e3b966d..f057e1e 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -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 } diff --git a/tools/arkmanager.cfg b/tools/arkmanager.cfg index 3c8185c..aa8a760 100644 --- a/tools/arkmanager.cfg +++ b/tools/arkmanager.cfg @@ -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"