Created
November 30, 2023 05:04
-
-
Save askrabal/362823526f8a0ef3ca07392d5c22189c to your computer and use it in GitHub Desktop.
ARK Survival Ascended server start/update script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p ~/.steam/steam | |
export STEAM_LIBRARY="$(realpath ~/.steam/steam/)" | |
app_id=2430930 | |
proton_id=2348590 | |
#lgsm vars | |
serverfiles="$(realpath ./serverfiles)" | |
systemdir="${serverfiles}/ShooterGame" | |
executabledir="${systemdir}/Binaries/Win64" | |
executable="./ArkAscendedServer.exe" | |
servercfgdir="${systemdir}/Saved/Config/WindowsServer" | |
servercfg="GameUserSettings.ini" | |
servercfgdefault="GameUserSettings.ini" | |
servercfgfullpath="${servercfgdir}/${servercfg}" | |
#custom vars | |
proton_dir="$(realpath ./serverfiles/Proton/)" | |
rconport="27020" | |
defaultmap="TheIsland_WP" | |
maxplayers="10" | |
sessionname="ARK Survival Ascended" | |
# must login with account for proton | |
if [[ "$1" == "u" ]];then | |
steamcmd \ | |
+force_install_dir ${proton_dir} \ | |
+login ${STEAM_USER} \ | |
+app_update ${proton_id} \ | |
validate \ | |
+quit | |
steamcmd \ | |
+@sSteamCmdForcePlatformType windows \ | |
+force_install_dir ${serverfiles} \ | |
+login anonymous \ | |
+app_update ${app_id} \ | |
validate \ | |
+quit | |
echo "Installed and validated" | |
fi | |
export STEAM_COMPAT_DATA_PATH="${serverfiles}/compatdata/${app_id}" | |
export STEAM_COMPAT_CLIENT_INSTALL_PATH="${STEAM_COMPAT_DATA_PATH}" | |
mkdir -p "${STEAM_COMPAT_DATA_PATH}" | |
echo "Config files at: ${servercfgdir}" | |
# proton verbs waitforexitandrun, runinprefix | |
"${proton_dir}"/proton runinprefix ${executabledir}/${executable} ${defaultmap}?listen?RCONPort=${rconport}?RCONEnabled=True?MaxPlayers=${maxplayers}?SessionName="${sessionname}" -WinLiveMaxPlayers=${maxplayers} -nosteamclient -NoBattlEye 2> /dev/null & | |
server_pid="$!" | |
echo "server pid: ${server_pid}" | |
wait "${server_pid}" | |
echo -e "\nServer shutdown" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment