Add options to overwrite GameUserSettings.ini and Game.ini

This commit is contained in:
Ben Peddell 2020-02-25 23:25:19 +10:00
parent 36b8a3e7fd
commit d52f49ba27
2 changed files with 35 additions and 0 deletions

View File

@ -538,6 +538,21 @@ crash-restart loop if the cause of the crash is not resolved.
`arkBackupPreUpdate`::
Set to `true` to enable automatic backups before updating
`arkPreStart`::
Set to the path to a script to execute on startup if it exists
+
default: /path/to/instance/config.start
`arkGameUserSettingsIniFile`::
Set to the path to an ini file to replace GameUserSettings.ini on startup if it exists
+
default: /path/to/instance/config.GameUserSettings.ini
`arkGameIniFile`::
Set to the path to an ini file to replace Game.ini on startup if it exists
+
default: /path/to/instance/config.Game.ini
`arkStagingDir`::
Sets the staging directory in order to download updates
before shutting down the server

View File

@ -1311,12 +1311,32 @@ doStart() {
if [ -n "$serverpid" ] && kill -0 "$serverpid"; then
logprint "Start aborted due to server already running - pid: $serverpid"
else
local saverootdir="${arkserverroot}/${arkserverdir}/Saved"
local savedcfgdir="${saverootdir}/Config/LinuxServer"
local prestart="${configfile%.cfg}.start"
local gusini="${configfile%.cfg}.GameUserSettings.ini"
local gameini="${configfile%.cfg}.Game.ini"
if [ -n "${arkGameUserSettingsIniFile}" ]; then
gusini="${arkGameUserSettingsIniFile}"
fi
if [ -n "${arkGameIniFile}" ]; then
gameini="${arkGameIniFile}"
fi
if [ -n "${arkPreStart}" ]; then
prestart="${arkPreStart}"
fi
if [[ -n "${gusini}" && -f "${gusini}" ]]; then
cp "${gusini}" "${savedcfgdir}/GameUserSettings.ini"
fi
if [[ -n "${gameini}" && -f "${gameini}" ]]; then
cp "${gameini}" "${savedcfgdir}/Game.ini"
fi
if [[ -n "${prestart}" && -f "${prestart}" ]]; then
if [ -x "${prestart}" ]; then
"${prestart}" "$@"