diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index c11253717..9b79fae06 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -385,6 +385,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +fix_pz.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + fix_ro.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index a3c8afe39..9c773523a 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -58,6 +58,8 @@ if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then fix_nmrih.sh elif [ "${shortname}" == "onset" ]; then fix_onset.sh + elif [ "${shortname}" == "pz" ]; then + fix_pz.sh elif [ "${shortname}" == "rust" ]; then fix_rust.sh elif [ "${shortname}" == "rw" ]; then diff --git a/lgsm/functions/fix_cmw.sh b/lgsm/functions/fix_cmw.sh index 7dc502be6..ac1e3d089 100644 --- a/lgsm/functions/fix_cmw.sh +++ b/lgsm/functions/fix_cmw.sh @@ -12,12 +12,11 @@ if [ ! -f "${executabledir}/steam_appid.txt" ]; then fn_fix_msg_end fi - if [ ! -f "${executabledir}/lib/steamclient.so" ]; then - fixname="steamclient.so" + fixname="steamclient.so x86" fn_fix_msg_start if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${executabledir}/lib/steamclient.so" + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${executabledir}/lib/steamclient.so" elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then cp "${steamcmddir}/linux32/steamclient.so" "${executabledir}/lib/steamclient.so" fi diff --git a/lgsm/functions/fix_cs.sh b/lgsm/functions/fix_cs.sh index de1fa175b..6f1f1eca7 100644 --- a/lgsm/functions/fix_cs.sh +++ b/lgsm/functions/fix_cs.sh @@ -6,16 +6,14 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ "${shortname}" == "cs" ]; then - # Fixes: steamclient.so: cannot open shared object file: No such file or directory - if [ ! -f "${serverfiles}/steamclient.so" ]; then - fixname="steamclient.so x86" - fn_fix_msg_start - if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/steamclient.so" >> "${lgsmlog}" - elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/steamclient.so" >> "${lgsmlog}" - fi - fn_fix_msg_end +# Fixes: steamclient.so: cannot open shared object file: No such file or directory +if [ ! -f "${serverfiles}/steamclient.so" ]; then + fixname="steamclient.so x86" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/steamclient.so" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/steamclient.so" fi + fn_fix_msg_end fi diff --git a/lgsm/functions/fix_hw.sh b/lgsm/functions/fix_hw.sh index 00b9d675d..cccc9d0ed 100644 --- a/lgsm/functions/fix_hw.sh +++ b/lgsm/functions/fix_hw.sh @@ -12,7 +12,7 @@ if [ "${shortname}" == "hw" ]; then fixname="steamclient.so x86" fn_fix_msg_start if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" fi @@ -22,7 +22,7 @@ if [ "${shortname}" == "hw" ]; then fixname="steamclient.so x86_64" fn_fix_msg_start if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then - cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" + cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" fi diff --git a/lgsm/functions/fix_pz.sh b/lgsm/functions/fix_pz.sh new file mode 100644 index 000000000..c49a624ba --- /dev/null +++ b/lgsm/functions/fix_pz.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LinuxGSM fix_pz.sh function +# Author: Christian Birk +# Website: https://linuxgsm.com +# Description: Resolves various issues with Project Zomboid. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. +if [ ! -f "${serverfiles}/linux32/steamclient.so" ]; then + fixname="steamclient.so x86" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/linux32/steamclient.so" >> "${lgsmlog}" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/linux32/steamclient.so" >> "${lgsmlog}" + fi + fn_fix_msg_end +fi + +if [ ! -f "${serverfiles}/linux64/steamclient.so" ]; then + fixname="steamclient.so x86_64" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${serverfiles}/linux64/steamclient.so" >> "${lgsmlog}" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/linux64/steamclient.so" >> "${lgsmlog}" + fi + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index 0a2f774f1..fc02dd60e 100644 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -12,7 +12,7 @@ if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then fn_fix_msg_start mkdir -pv "${HOME}/.steam/sdk64" >> "${lgsmlog}" if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then - cp "${steamcmddir}/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" >> "${lgsmlog}" + cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" >> "${lgsmlog}" elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then cp "${steamcmddir}/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" >> "${lgsmlog}" fi @@ -25,7 +25,7 @@ if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then fn_fix_msg_start mkdir -pv "${HOME}/.steam/sdk32" >> "${lgsmlog}" if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${lgsmlog}" + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${lgsmlog}" elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then cp "${steamcmddir}/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${lgsmlog}" fi diff --git a/lgsm/functions/fix_tu.sh b/lgsm/functions/fix_tu.sh index 1f01fd7b3..5d09bf3c2 100644 --- a/lgsm/functions/fix_tu.sh +++ b/lgsm/functions/fix_tu.sh @@ -6,12 +6,14 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ "${shortname}" == "tu" ]; then - # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. - if [ ! -f "${executabledir}/steamclient.so" ]; then - fixname="steamclient.so" - fn_fix_msg_start - cp -v "${serverfiles}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" - fn_fix_msg_end +# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. +if [ ! -f "${executabledir}/steamclient.so" ]; then + fixname="steamclient.so x86_64" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + cp "${steamcmddir}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" fi + fn_fix_msg_end fi diff --git a/lgsm/functions/fix_wurm.sh b/lgsm/functions/fix_wurm.sh index dfba3afdc..1285fb54e 100644 --- a/lgsm/functions/fix_wurm.sh +++ b/lgsm/functions/fix_wurm.sh @@ -6,9 +6,15 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Copies steamclient.so to correct location. if [ ! -f "${serverfiles}/nativelibs" ]; then - cp -f "${serverfiles}/linux64/steamclient.so" "${serverfiles}/nativelibs" + fixname="steamclient.so x86" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/nativelibs" >> "${lgsmlog}" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/nativelibs" >> "${lgsmlog}" + fi + fn_fix_msg_end fi # First run requires start with no parms.