fix_mohaa.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # LinuxGSM fix_mohaa.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Resolves issues with Medal of Honor: Allied Assault and its expansions.
  7. # shellcheck disable=SC2034 # Used by the module loader.
  8. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  9. export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"
  10. if ldd "${executabledir}/${executable#./}" 2>&1 | grep -q "libstdc++\.so\.5 => not found"; then
  11. # shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
  12. fixname="libstdc++5 i386"
  13. fn_fix_msg_start_nl
  14. fn_fetch_file "https://linuxgsm.download/libraries/libstdc++5-i386-3.3.6-34.tar.xz" "" "" "" "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "nochmodx" "norun" "noforce" "288a4cc9d6b7647f28c702028437e0f3"
  15. fn_dl_extract "${tmpdir}" "libstdc++5-i386-3.3.6-34.tar.xz" "${serverfiles}"
  16. fn_clear_tmp
  17. fn_fix_msg_end
  18. fi
  19. if [ -f "${executabledir}/${executable#./}" ]; then
  20. executablemd5="$(md5sum "${executabledir}/${executable#./}" | awk '{print $1}')"
  21. if [ "${executablemd5}" == "6d8c51fa1a3a7b3d392348dd6cb2e4c5" ] || [ "${executablemd5}" == "b1e012bc32ea60d93b99dea8e8a33b86" ] || [ "${executablemd5}" == "32ec01ef4e9986cf4a0de27b3157cabf" ]; then
  22. # shellcheck disable=SC2034 # Used by fn_fix_msg_start and fn_fix_msg_end.
  23. fixname="master server"
  24. fn_fix_msg_start
  25. LC_ALL=C sed -i -e 's/master\.gamespy\.com/master.gametir.com/g' -e 's/master\.x-null\.net\x00/master.gametir.com/g' "${executabledir}/${executable#./}"
  26. fn_fix_msg_end
  27. fi
  28. fi