Browse Source

fix(arkserver): remove all appworkshop_346110.acf if multiple exist (#2852)

pull/2853/head
Daniel Gibbs 5 years ago
committed by GitHub
parent
commit
216c29d0e5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lgsm/functions/command_validate.sh
  2. 78
      lgsm/functions/fix_ark.sh

2
lgsm/functions/command_validate.sh

@ -90,3 +90,5 @@ if [ "${status}" != "0" ]; then
else else
fn_validate fn_validate
fi fi
core_exit.sh

78
lgsm/functions/fix_ark.sh

@ -4,44 +4,52 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with ARK: Survival Evolved. # Description: Resolves various issues with ARK: Survival Evolved.
# Steam mods directory selecter # removes mulitple appworkshop_346110.acf if found.
# This allows LinxuGSM to select either ~/.steam or ~/Steam. depending on what is being used steamappsfilewc=$(find ${HOME} -name appworkshop_346110.acf | wc -l)
if [ "${steamappsfilewc}" -gt "1" ]; then
steamappsfile=$(find ${HOME} -name appworkshop_346110.acf) fixname="multiple appworkshop acf files"
steamappsdir=$(dirname "${steamappsfile}")
steamappspath=$(cd ${steamappsdir};cd ../;pwd)
# removes the symlink if exists.
# fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd
if [ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then
fixname="broken SteamCMD symlink"
fn_fix_msg_start fn_fix_msg_start
unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux" find ${HOME} -name appworkshop_346110.acf -exec rm -f {} \;
fn_fix_msg_end fn_fix_msg_end
check_steamcmd.sh elif [ "${steamappsfilewc}" -eq "1" ]; then
fi # Steam mods directory selecter
# This allows LinxuGSM to select either ~/.steam or ~/Steam. depending on what is being used
steamappsfile=$(find ${HOME} -name appworkshop_346110.acf)
steamappsdir=$(dirname "${steamappsfile}")
steamappspath=$(cd "${steamappsdir}"|| return; cd ../;pwd)
# removed ARK steamcmd directory if steamcmd is missing. # removes the symlink if exists.
if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then # fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd
fixname="remove invalid ARK SteamCMD directory" if [ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then
fn_fix_msg_start fixname="broken SteamCMD symlink"
rm -rf "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux" fn_fix_msg_start
fn_fix_msg_end unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
check_steamcmd.sh fn_fix_msg_end
fi check_steamcmd.sh
fi
# if the steamapps symlink is incorrect unlink it. # removed ARK steamcmd directory if steamcmd is missing.
if [ -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]&&[ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]&&[ "$(readlink ${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps)" != "${steamappspath}" ]; then if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then
fixname="incorrect steamapps symlink" fixname="remove invalid ARK SteamCMD directory"
fn_fix_msg_start fn_fix_msg_start
unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" rm -rf "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
fn_fix_msg_end fn_fix_msg_end
fi check_steamcmd.sh
fi
# Put symlink to steamapps directory into the ARK SteamCMD directory to link the downloaded mods to the correct location. # if the steamapps symlink is incorrect unlink it.
if [ ! -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then if [ -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]&&[ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]&&[ "$(readlink ${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps)" != "${steamappspath}" ]; then
fixname="steamapps symlink" fixname="incorrect steamapps symlink"
fn_fix_msg_start fn_fix_msg_start
ln -s "${steamappspath}" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps"
fn_fix_msg_end fn_fix_msg_end
fi
# Put symlink to steamapps directory into the ARK SteamCMD directory to link the downloaded mods to the correct location.
if [ ! -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then
fixname="steamapps symlink"
fn_fix_msg_start
ln -s "${steamappspath}" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps"
fn_fix_msg_end
fi
fi fi

Loading…
Cancel
Save