mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-13 11:28:26 +00:00
Merge pull request #604 from FezVrasta/1.6-dev-rc
Release ARK Server Tools v1.6
This commit is contained in:
commit
7636f0a5a7
155
README.asciidoc
155
README.asciidoc
@ -129,6 +129,9 @@ Instanceless commands
|
||||
`useconfig`::
|
||||
Legacy command for specifying an instance for the following command(s)
|
||||
|
||||
`remove-mods`::
|
||||
Remove the specified mods from the `steamcmd` workshop directory
|
||||
|
||||
Commands acting on instances
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -146,12 +149,20 @@ instances.
|
||||
`--noautoupdate`;;
|
||||
Disables automatic updating on startup if it is enabled
|
||||
|
||||
`--alwaysrestart`;;
|
||||
Enable automatically restarting the server even if it crashes
|
||||
without becoming ready for player connections.
|
||||
|
||||
|
||||
`stop`::
|
||||
Stops the server if it is running
|
||||
|
||||
`--warn`;;
|
||||
Warns any connected players that the server is going down
|
||||
|
||||
`--warnreason`;;
|
||||
Gives a reason for the shutdown. Defaults to `maintenance`
|
||||
|
||||
`--saveworld`;;
|
||||
Saves the world using `saveworld` - usually not
|
||||
necessary, as server usually saves the world on a graceful
|
||||
@ -161,6 +172,9 @@ instances.
|
||||
Runs the `stop` command followed by the `restart` command.
|
||||
Accepts and passes the options for those commands
|
||||
|
||||
`--warnreason`;;
|
||||
Gives a reason for the restart. Defaults to `a restart`
|
||||
|
||||
`install`::
|
||||
Downloads and installs (or validates an existing install) of
|
||||
the ARK server
|
||||
@ -205,21 +219,51 @@ instances.
|
||||
Downloads the update but does not apply it. Only has effect
|
||||
if a staging directory is set.
|
||||
|
||||
`cancelshutdown`::
|
||||
Cancels a pending update / shutdown / restart that was run with
|
||||
the `--warn` option
|
||||
|
||||
`checkupdate`::
|
||||
Checks if an ARK server update is available
|
||||
|
||||
`installmod <modnum>`::
|
||||
Installs the specified mod into the `ShooterGame/Content/Mods`
|
||||
`installmods`::
|
||||
Installs all mods specified in the instance config into the
|
||||
`ShooterGame/Content/Mods` directory
|
||||
|
||||
`uninstallmods`::
|
||||
Deletes all mods from the `ShooterGame/Content/Mods` directory
|
||||
|
||||
`installmod <modnum>[,<modnum>[,...]]`::
|
||||
Installs the specified mods into the `ShooterGame/Content/Mods`
|
||||
directory
|
||||
|
||||
`uninstallmod <modnum>`::
|
||||
Deletes the specified mod from the `ShooterGame/Content/Mods`
|
||||
`uninstallmod <modnum>[,<modnum>[,...]]`::
|
||||
Deletes the specified mods from the `ShooterGame/Content/Mods`
|
||||
directory
|
||||
|
||||
`reinstallmod <modnum>`::
|
||||
`removemod <modnum>[,<modnum>[,...]]`::
|
||||
Deletes the specified mods from the SteamCMD workshop directory
|
||||
|
||||
`reinstallmod <modnum>[,<modnum>[,...]]`::
|
||||
Runs the `uninstallmod` command followed by the `installmod`
|
||||
command
|
||||
|
||||
`enablemod <modnum>`::
|
||||
`enablemod <modnum>=<modtype>`::
|
||||
Enables the `arkmod_<modnum>` setting in the instance config.
|
||||
modtype defaults to `game`.
|
||||
Mod types:
|
||||
|
||||
`game`;;
|
||||
A mod in `GameModIds`
|
||||
|
||||
`map`;;
|
||||
The `MapModId` mod
|
||||
|
||||
`tc`;;
|
||||
`totalconversion`;;
|
||||
The `TotalConversionMod` mod
|
||||
|
||||
`backup`::
|
||||
Backs up the saved world and game config files to a compressed
|
||||
tar file in the backups directory specified in the config
|
||||
@ -238,6 +282,46 @@ instances.
|
||||
`status`::
|
||||
Prints the status of the ARK server
|
||||
|
||||
`install-cronjob <command>`::
|
||||
Installs a cron job that executes the specified command.
|
||||
This accepts any of the options the specified command accepts,
|
||||
as well as the following options. In order to specify an
|
||||
argument to the command (e.g. to the `broadcast` command),
|
||||
use the `--arg=<arg>` option.
|
||||
Please read your `man 5 crontab` manpage to determine what
|
||||
minute and hour values are valid, as some implementations
|
||||
may not accept e.g. the `*/n` minute / hour specification.
|
||||
|
||||
`--daily`;;
|
||||
The command should be executed daily
|
||||
|
||||
`--hourly`;;
|
||||
The command should be executed hourly
|
||||
|
||||
`--hour=<hour>`;;
|
||||
Specifies one or more hours when the command should execute.
|
||||
This is the hour field of the cron job.
|
||||
If you want to have the command execute every n hours, then
|
||||
use `--hour='*/n'`
|
||||
Default: `*` (i.e. all hours)
|
||||
|
||||
`--minute=<minute>`;;
|
||||
Specifies one or more minutes of the hour when the command
|
||||
should execute. This is the minute field of the cron job.
|
||||
If you want to have the command execute every n minutes,
|
||||
then use `--minute='*/n'`
|
||||
Default: `0` (i.e. the first minute of the hour)
|
||||
|
||||
`--enable-output`;;
|
||||
Enables the output from the command - the cron daemon usually
|
||||
emails this to the user specified in the cron configuration
|
||||
|
||||
`--arg=<arg>`;;
|
||||
Specifies an argument to pass to the command
|
||||
|
||||
`remove-cronjob <command>`::
|
||||
Removes a cron job previously installed by `install-cronjob`
|
||||
|
||||
Configuration files
|
||||
-------------------
|
||||
|
||||
@ -299,6 +383,12 @@ The following options can be overridden on a per-instance basis:
|
||||
The relative path within an ARK server install to place the
|
||||
autorestart lock file
|
||||
|
||||
`arkAlwaysRestartOnCrash`::
|
||||
Set to `true` to enable automatically restarting even when the
|
||||
server has not become ready for player connections.
|
||||
Be aware that this may cause the server to enter an endless
|
||||
crash-restart loop if the cause of the crash is not resolved.
|
||||
|
||||
`arkAutoUpdateOnStart`::
|
||||
Set to `true` to enable updating before server startup
|
||||
|
||||
@ -312,6 +402,11 @@ The following options can be overridden on a per-instance basis:
|
||||
`arkMaxBackupSizeMB`::
|
||||
Limits the size of the stored backups
|
||||
|
||||
`arkPriorityBoost`::
|
||||
Attempts to boost the priority of the ARK server.
|
||||
Negative values give a higher priority, and positive values give a lower priority.
|
||||
Requires `sudo` and `renice`
|
||||
|
||||
`msgWarnUpdateMinutes`::
|
||||
`msgWarnUpdateSeconds`::
|
||||
`msgWarnRestartMinutes`::
|
||||
@ -321,6 +416,32 @@ The following options can be overridden on a per-instance basis:
|
||||
Templated messages for warnings, where `%d` is replaced with the
|
||||
number of minutes / seconds before the update / restart / shutdown
|
||||
|
||||
`msgWarnReason`::
|
||||
`msgTimeMinutes`::
|
||||
`msgTimeSeconds`::
|
||||
`msgReasonUpdateApp`::
|
||||
`msgReasonUpdateMod`::
|
||||
`msgReasonUpdateAppMod`::
|
||||
`msgReasonRestart`::
|
||||
`msgReasonShutdown`::
|
||||
Alternative templated messages for warnings with the following
|
||||
replacement parameters:
|
||||
|
||||
`{reason}`;;
|
||||
Valid in `msgWarnReason`, replaced at runtime with the appropriate `msgReason*` template
|
||||
|
||||
`{time}`;;
|
||||
Valid in `msgWarnReason` and `msgReason*`, replaced at runtime with the appropriate `msgTime*` template
|
||||
|
||||
`{modnamesupdated}`;;
|
||||
Valid in `msgReason*Mod`, replaced at runtime with a comma-delimited list of updated mod names
|
||||
|
||||
`{minutes}`;;
|
||||
Valid in `msgTimeMinutes`, replaced at runtime with minutes remaining until shutdown
|
||||
|
||||
`{seconds}`;;
|
||||
Valid in `msgTimeSeconds`, replaced at runtime with seconds remaining until shutdown
|
||||
|
||||
`logdir`::
|
||||
Specifies where to store log files
|
||||
|
||||
@ -401,6 +522,30 @@ the global config.
|
||||
the `-StructureDestructionTag=DestroySwampSnowStructures`
|
||||
option.
|
||||
|
||||
`arkmod_<modnum>=<modtype>`::
|
||||
Specifies a mod that can be enabled or disabled using
|
||||
`enablemod` and `disablemod`. Note that mod ids specified
|
||||
using these options are in addition to those specified directly
|
||||
in the `ark_GameModIds` option, and override those specified in the
|
||||
`ark_MapModId`, `serverMapMod` and `ark_TotalConversionMod`
|
||||
options. Options are processed in the order they are specified
|
||||
in the instance config file, and `arkmod_*` options in the
|
||||
common config file are not applied.
|
||||
Mod types:
|
||||
|
||||
`game`;;
|
||||
A mod to be specified in `GameModIds`
|
||||
|
||||
`map`;;
|
||||
The mod to be specified in `MapModId`
|
||||
|
||||
`tc`;;
|
||||
`totalconversion`;;
|
||||
The mod to be specified in `TotalConversionMod`
|
||||
|
||||
`disabled`;;
|
||||
A disabled mod
|
||||
|
||||
Common ARK options
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
121
netinstall.sh
121
netinstall.sh
@ -4,6 +4,8 @@
|
||||
# Net Installer, used with curl
|
||||
#
|
||||
|
||||
arkstGithubRepo="FezVrasta/ark-server-tools"
|
||||
|
||||
steamcmd_user="$1"
|
||||
channel=${2:-master} # if defined by 2nd argument install the defined version, otherwise install master
|
||||
shift
|
||||
@ -19,50 +21,83 @@ elif [[ "$1" =~ ^--output= ]]; then
|
||||
shift
|
||||
fi
|
||||
|
||||
# Download and untar installation files
|
||||
cd /tmp
|
||||
COMMIT="`curl -L -k -s https://api.github.com/repos/FezVrasta/ark-server-tools/git/refs/heads/${channel} | sed -n 's/^ *"sha": "\(.*\)",.*/\1/p'`"
|
||||
unstable=
|
||||
if [ "$1" = "--unstable" ]; then
|
||||
unstable=1
|
||||
fi
|
||||
|
||||
if [ -z "$COMMIT" ]; then
|
||||
if [ "$channel" != "master" ]; then
|
||||
echo "Channel ${channel} not found - trying master"
|
||||
channel=master
|
||||
COMMIT="`curl -L -k -s https://api.github.com/repos/FezVrasta/ark-server-tools/git/refs/heads/${channel} | sed -n 's/^ *"sha": "\(.*\)",.*/\1/p'`"
|
||||
function doInstallFromCommit(){
|
||||
local commit="$1"
|
||||
tmpdir="$(mktemp -t -d "ark-server-tools-XXXXXXXX")"
|
||||
if [ -z "$tmpdir" ]; then echo "Unable to create temporary directory"; exit 1; fi
|
||||
cd "$tmpdir"
|
||||
echo "Downloading installer"
|
||||
curl -s -L "https://github.com/${arkstGithubRepo}/archive/${commit}.tar.gz" | tar -xz
|
||||
cd "ark-server-tools-${commit}/tools"
|
||||
if [ ! -f "install.sh" ]; then echo "install.sh not found in $PWD"; exit 1; fi
|
||||
sed -i -e "s|^arkstCommit='.*'|arkstCommit='${commit}'|" \
|
||||
-e "s|^arkstTag='.*'|arkstTag='${tagname}'|" \
|
||||
arkmanager
|
||||
echo "Running install.sh"
|
||||
bash install.sh "$steamcmd_user" "${reinstall_args[@]}"
|
||||
result=$?
|
||||
cd /
|
||||
rm -rf "$tmpdir"
|
||||
|
||||
if [ "$result" = 0 ] || [ "$result" = 2 ]; then
|
||||
echo "ARK Server Tools successfully installed"
|
||||
else
|
||||
echo "ARK Server Tools install failed"
|
||||
fi
|
||||
return $result
|
||||
}
|
||||
|
||||
function doInstallFromRelease(){
|
||||
local tagname=
|
||||
local desc=
|
||||
|
||||
echo "Getting latest release..."
|
||||
# Read the variables from github
|
||||
while IFS=$'\t' read n v; do
|
||||
case "${n}" in
|
||||
tag_name) tagname="${v}"; ;;
|
||||
body) desc="${v}"
|
||||
esac
|
||||
done < <(curl -s "https://api.github.com/repos/${arkstGithubRepo}/releases/latest" | sed -n 's/^ "\([^"]*\)": "*\([^"]*\)"*,*/\1\t\2/p')
|
||||
|
||||
if [ -n "$tagname" ]; then
|
||||
echo "Latest release is ${tagname}"
|
||||
echo "Getting commit for latest release..."
|
||||
local commit="$(curl -s "https://api.github.com/repos/${arkstGithubRepo}/git/refs/tags/${tagname}" | sed -n 's/^ *"sha": "\(.*\)",.*/\1/p')"
|
||||
doInstallFromCommit "$commit"
|
||||
else
|
||||
echo "Unable to get latest release"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function doInstallFromBranch(){
|
||||
channel="$1"
|
||||
commit="`curl -s "https://api.github.com/repos/${arkstGithubRepo}/git/refs/heads/${channel}" | sed -n 's/^ *"sha": "\(.*\)",.*/\1/p'`"
|
||||
|
||||
if [ -z "$commit" ]; then
|
||||
if [ -n "$unstable" ]; then
|
||||
echo "Channel ${channel} not found - trying master"
|
||||
doInstallFromBranch master
|
||||
else
|
||||
doInstallFromRelease
|
||||
fi
|
||||
else
|
||||
doInstallFromCommit "$commit"
|
||||
fi
|
||||
}
|
||||
|
||||
# Download and untar installation files
|
||||
cd "$TEMP"
|
||||
|
||||
if [ "$channel" = "master" ] && [ -z "$unstable" ]; then
|
||||
doInstallFromRelease
|
||||
else
|
||||
doInstallFromBranch "$channel"
|
||||
fi
|
||||
|
||||
if [ -z "$COMMIT" ]; then
|
||||
echo "Unable to retrieve latest commit"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir ark-server-tools-${channel}
|
||||
cd ark-server-tools-${channel}
|
||||
curl -L -k -s https://github.com/FezVrasta/ark-server-tools/archive/${COMMIT}.tar.gz | tar xz
|
||||
|
||||
# Install ARK Server Tools
|
||||
cd ark-server-tools-${COMMIT}/tools
|
||||
sed -i "s|^arkstCommit='.*'$|arkstCommit='${COMMIT}'|" arkmanager
|
||||
version=`<../.version`
|
||||
sed -i "s|^arkstVersion=\".*\"|arkstVersion='${version}'|" arkmanager
|
||||
chmod +x install.sh
|
||||
bash install.sh "$steamcmd_user" "$@" >"$output" 2>&1
|
||||
|
||||
status=$?
|
||||
|
||||
rm -rf /tmp/ark-server-tools-${channel}
|
||||
|
||||
# Print messages
|
||||
case "$status" in
|
||||
"0")
|
||||
echo "ARK Server Tools were correctly installed in your system inside the home directory of $steamcmd_user!"
|
||||
;;
|
||||
|
||||
"1")
|
||||
echo "Something went wrong :( Make sure you meet the Prerequisites found in the readme."
|
||||
;;
|
||||
"2")
|
||||
echo "WARNING: A previous version of ARK Server Tools was detected in your system, your old configuration was not overwritten. You may need to manually update it."
|
||||
echo "ARK Server Tools were correctly installed in your system inside the home directory of $steamcmd_user!"
|
||||
;;
|
||||
esac
|
||||
|
||||
1660
tools/arkmanager
1660
tools/arkmanager
File diff suppressed because it is too large
Load Diff
@ -32,6 +32,10 @@ msgWarnRestartMinutes="This ARK server will shutdown for a restart in %d minutes
|
||||
msgWarnRestartSeconds="This ARK server will shutdown for a restart in %d seconds"
|
||||
msgWarnShutdownMinutes="This ARK server will shutdown in %d minutes"
|
||||
msgWarnShutdownSeconds="This ARK server will shutdown in %d seconds"
|
||||
msgWarnCancelled="Restart cancelled by player request"
|
||||
|
||||
# Restart cancel chat command
|
||||
#chatCommandRestartCancel="/cancelupdate"
|
||||
|
||||
# ARK server common options - use ark_<optionname>=<value>
|
||||
# comment out these values if you want to define them
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
userinstall=no
|
||||
steamcmd_user=
|
||||
showusage=no
|
||||
migrateconfig=no
|
||||
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
@ -63,6 +64,9 @@ while [ -n "$1" ]; do
|
||||
DATADIR="$2"
|
||||
shift
|
||||
;;
|
||||
--migrate-config)
|
||||
migrateconfig=yes
|
||||
;;
|
||||
-*)
|
||||
echo "Invalid option '$1'"
|
||||
showusage=yes
|
||||
@ -169,7 +173,7 @@ if [ "$userinstall" == "yes" ]; then
|
||||
"${INSTALL_ROOT}${INSTANCEDIR}/instance.cfg.example"
|
||||
|
||||
# Copy arkmanager.cfg to ~/.arkmanager.cfg.NEW
|
||||
cp arkmanager.cfg "${INSTALL_ROOT}${CONFIGFILE}.NEW"
|
||||
cp arkmanager.cfg "${INSTALL_ROOT}${CONFIGFILE}.example"
|
||||
# Change the defaults in the new config file
|
||||
sed -i -e "s|^steamcmd_user=\"steam\"|steamcmd_user=\"--me\"|" \
|
||||
-e "s|\"/home/steam|\"${PREFIX}|" \
|
||||
@ -177,18 +181,24 @@ if [ "$userinstall" == "yes" ]; then
|
||||
-e "s|^install_bindir=.*|install_bindir=\"${BINDIR}\"|" \
|
||||
-e "s|^install_libexecdir=.*|install_libexecdir=\"${LIBEXECDIR}\"|" \
|
||||
-e "s|^install_datadir=.*|install_datadir=\"${DATADIR}\"|" \
|
||||
"${INSTALL_ROOT}${CONFIGFILE}.NEW"
|
||||
"${INSTALL_ROOT}${CONFIGFILE}.example"
|
||||
|
||||
# Copy arkmanager.cfg to ~/.arkmanager.cfg if it doesn't already exist
|
||||
if [ -f "${INSTALL_ROOT}${CONFIGFILE}" ]; then
|
||||
bash ./migrate-config.sh "${INSTALL_ROOT}${CONFIGFILE}"
|
||||
bash ./migrate-main-instance.sh "${INSTALL_ROOT}${CONFIGFILE}" "${INSTALL_ROOT}${INSTANCEDIR}/main.cfg"
|
||||
SUFFIX=
|
||||
if [ "$migrateconfig" = "no" ]; then
|
||||
SUFFIX=".NEW"
|
||||
cp "${INSTALL_ROOT}${CONFIGFILE}" "${INSTALL_ROOT}${CONFIGFILE}${SUFFIX}"
|
||||
fi
|
||||
|
||||
bash ./migrate-config.sh "${INSTALL_ROOT}${CONFIGFILE}${SUFFIX}"
|
||||
bash ./migrate-main-instance.sh "${INSTALL_ROOT}${CONFIGFILE}${SUFFIX}" "${INSTALL_ROOT}${INSTANCEDIR}/main.cfg${SUFFIX}"
|
||||
|
||||
echo "A previous version of ARK Server Tools was detected in your system, your old configuration was not overwritten. You may need to manually update it."
|
||||
echo "A copy of the new configuration file was included in '${CONFIGFILE}.NEW'. Make sure to review any changes and update your config accordingly!"
|
||||
exit 2
|
||||
else
|
||||
mv -n "${INSTALL_ROOT}${CONFIGFILE}.NEW" "${INSTALL_ROOT}${CONFIGFILE}"
|
||||
cp -n "${INSTALL_ROOT}${CONFIGFILE}.example" "${INSTALL_ROOT}${CONFIGFILE}"
|
||||
cp -n "${INSTALL_ROOT}/${INSTANCEDIR}/instance.cfg.example" "${INSTALL_ROOT}/${INSTANCEDIR}/main.cfg"
|
||||
fi
|
||||
else
|
||||
@ -301,24 +311,30 @@ else
|
||||
# Copy arkmanager.cfg inside linux configuation folder if it doesn't already exists
|
||||
mkdir -p "${INSTALL_ROOT}/etc/arkmanager"
|
||||
chown "$steamcmd_user" "${INSTALL_ROOT}/etc/arkmanager"
|
||||
cp arkmanager.cfg "${INSTALL_ROOT}${CONFIGFILE}.NEW"
|
||||
chown "$steamcmd_user" "${INSTALL_ROOT}${CONFIGFILE}.NEW"
|
||||
cp arkmanager.cfg "${INSTALL_ROOT}${CONFIGFILE}.example"
|
||||
chown "$steamcmd_user" "${INSTALL_ROOT}${CONFIGFILE}.example"
|
||||
sed -i -e "s|^steamcmd_user=\"steam\"|steamcmd_user=\"$steamcmd_user\"|" \
|
||||
-e "s|\"/home/steam|\"/home/$steamcmd_user|" \
|
||||
-e "s|^install_bindir=.*|install_bindir=\"${BINDIR}\"|" \
|
||||
-e "s|^install_libexecdir=.*|install_libexecdir=\"${LIBEXECDIR}\"|" \
|
||||
-e "s|^install_datadir=.*|install_datadir=\"${DATADIR}\"|" \
|
||||
"${INSTALL_ROOT}${CONFIGFILE}.NEW"
|
||||
"${INSTALL_ROOT}${CONFIGFILE}.example"
|
||||
|
||||
if [ -f "${INSTALL_ROOT}${CONFIGFILE}" ]; then
|
||||
bash ./migrate-config.sh "${INSTALL_ROOT}${CONFIGFILE}"
|
||||
bash ./migrate-main-instance.sh "${INSTALL_ROOT}${CONFIGFILE}" "${INSTALL_ROOT}${INSTANCEDIR}/main.cfg"
|
||||
SUFFIX=
|
||||
if [ "$migrateconfig" = "no" ]; then
|
||||
SUFFIX=".NEW"
|
||||
cp "${INSTALL_ROOT}${CONFIGFILE}" "${INSTALL_ROOT}${CONFIGFILE}${SUFFIX}"
|
||||
fi
|
||||
|
||||
bash ./migrate-config.sh "${INSTALL_ROOT}${CONFIGFILE}${SUFFIX}"
|
||||
bash ./migrate-main-instance.sh "${INSTALL_ROOT}${CONFIGFILE}${SUFFIX}" "${INSTALL_ROOT}${INSTANCEDIR}/main.cfg${SUFFIX}"
|
||||
|
||||
echo "A previous version of ARK Server Tools was detected in your system, your old configuration was not overwritten. You may need to manually update it."
|
||||
echo "A copy of the new configuration file was included in /etc/arkmanager. Make sure to review any changes and update your config accordingly!"
|
||||
exit 2
|
||||
else
|
||||
mv -n "${INSTALL_ROOT}${CONFIGFILE}.NEW" "${INSTALL_ROOT}${CONFIGFILE}"
|
||||
cp -n "${INSTALL_ROOT}${CONFIGFILE}.example" "${INSTALL_ROOT}${CONFIGFILE}"
|
||||
cp -n "${INSTALL_ROOT}/${INSTANCEDIR}/instance.cfg.example" "${INSTALL_ROOT}/${INSTANCEDIR}/main.cfg"
|
||||
fi
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user