4
0

fix_ahl.sh 1.4 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # LinuxGSM fix_ahl.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Resolves issues with Action Half-Life.
  7. # shellcheck disable=SC2034 # Used by the module loader.
  8. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  9. export GLIBC_TUNABLES="${GLIBC_TUNABLES:+${GLIBC_TUNABLES}:}glibc.rtld.execstack=2"
  10. rehldsversion="3.15.0.896"
  11. rehldsfile="rehlds-bin-${rehldsversion}.zip"
  12. if ! grep -qs '"BetaKey"[[:space:]]*"steam_legacy"' "${serverfiles}/steamapps/appmanifest_90.acf"; then
  13. fn_print_warn_nl "ReHLDS requires the steam_legacy branch: run ./${selfname} force-update"
  14. fn_script_log_warn "ReHLDS requires the steam_legacy branch: run ./${selfname} force-update"
  15. elif [ "$(md5sum "${serverfiles}/engine_i486.so" 2> /dev/null | awk '{print $1}')" != "a3aa351c97922f17b8290dce3f5b9bf0" ]; then
  16. # shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
  17. fixname="ReHLDS ${rehldsversion}"
  18. fn_fix_msg_start_nl
  19. fn_fetch_file "https://github.com/rehlds/ReHLDS/releases/download/${rehldsversion}/${rehldsfile}" "" "" "" "${tmpdir}" "${rehldsfile}" "nochmodx" "norun" "noforce" "87b8dd8bce18ccc2295069f7382bb4d3"
  20. fn_dl_extract "${tmpdir}" "${rehldsfile}" "${tmpdir}/rehlds"
  21. cp -a "${tmpdir}/rehlds/bin/linux32/." "${serverfiles}/"
  22. chmod +x "${serverfiles}/hlds_linux" "${serverfiles}/hltv"
  23. fn_clear_tmp
  24. fn_fix_msg_end
  25. fi