fix_kf.sh 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/bin/bash
  2. # LinuxGSM fix_kf.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Resolves issues with Killing Floor.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # echo -e "applying WebAdmin ROOst.css fix."
  9. # echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"
  10. sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css"
  11. sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css"
  12. # echo -e "applying WebAdmin CharSet fix."
  13. # echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1"
  14. sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int"
  15. # get md5sum of steamclient.so
  16. if [ -f "${serverfiles}/System/steamclient.so" ]; then
  17. steamclientmd5=$(md5sum "${serverfiles}/System/steamclient.so" | awk '{print $1;}')
  18. fi
  19. #get md5sum of libtier0_s.so
  20. if [ -f "${serverfiles}/System/libtier0_s.so" ]; then
  21. libtier0_smd5=$(md5sum "${serverfiles}/System/libtier0_s.so" | awk '{print $1;}')
  22. fi
  23. #get md5sum of libvstdlib_s.so
  24. if [ -f "${serverfiles}/System/libvstdlib_s.so" ]; then
  25. libvstdlib_smd5=$(md5sum "${serverfiles}/System/libvstdlib_s.so" | awk '{print $1;}')
  26. fi
  27. # get md5sum of steamclient.so from steamcmd
  28. if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
  29. steamcmdsteamclientmd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}')
  30. elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then
  31. steamcmdsteamclientmd5=$(md5sum "${steamcmddir}/linux32/steamclient.so" | awk '{print $1;}')
  32. elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then
  33. steamcmdsteamclientmd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}')
  34. fi
  35. # get md5sum of libtier0_s.so from steamcmd
  36. if [ -f "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" ]; then
  37. steamcmdlibtier0_smd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" | awk '{print $1;}')
  38. elif [ -f "${steamcmddir}/linux32/libtier0_s.so" ]; then
  39. steamcmdlibtier0_smd5=$(md5sum "${steamcmddir}/linux32/libtier0_s.so" | awk '{print $1;}')
  40. elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" ]; then
  41. steamcmdlibtier0_smd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" | awk '{print $1;}')
  42. fi
  43. # get md5sum of libvstdlib_s.so from steamcmd
  44. if [ -f "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" ]; then
  45. steamcmdlibvstdlib_smd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" | awk '{print $1;}')
  46. elif [ -f "${steamcmddir}/linux32/libvstdlib_s.so" ]; then
  47. steamcmdlibvstdlib_smd5=$(md5sum "${steamcmddir}/linux32/libvstdlib_s.so" | awk '{print $1;}')
  48. elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" ]; then
  49. steamcmdlibvstdlib_smd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" | awk '{print $1;}')
  50. fi
  51. if [ ! -f "${serverfiles}/System/steamclient.so" ] || [ "${steamcmdsteamclientmd5}" != "${steamclientmd5}" ]; then
  52. fixname="steamclient.so x86"
  53. fn_fix_msg_start
  54. if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
  55. cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/System/steamclient.so"
  56. elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then
  57. cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/System/steamclient.so"
  58. elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then
  59. cp "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" "${serverfiles}/System/steamclient.so"
  60. fi
  61. fn_fix_msg_end
  62. fi
  63. if [ ! -f "${serverfiles}/System/libtier0_s.so" ] || [ "${steamcmdlibtier0_smd5}" != "${libtier0_smd5}" ]; then
  64. fixname="libtier0_s.so"
  65. fn_fix_msg_start
  66. if [ -f "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" ]; then
  67. cp "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" "${serverfiles}/System/libtier0_s.so"
  68. elif [ -f "${steamcmddir}/linux32/libtier0_s.so" ]; then
  69. cp "${steamcmddir}/linux32/libtier0_s.so" "${serverfiles}/System/libtier0_s.so"
  70. elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" ]; then
  71. cp "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" "${serverfiles}/System/libtier0_s.so"
  72. fi
  73. fn_fix_msg_end
  74. fi
  75. if [ ! -f "${serverfiles}/System/libvstdlib_s.so" ] || [ "${steamcmdlibvstdlib_smd5}" != "${libvstdlib_smd5}" ]; then
  76. fixname="libvstdlib_s.so"
  77. fn_fix_msg_start
  78. if [ -f "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" ]; then
  79. cp "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" "${serverfiles}/System/libvstdlib_s.so"
  80. elif [ -f "${steamcmddir}/linux32/libvstdlib_s.so" ]; then
  81. cp "${steamcmddir}/linux32/libvstdlib_s.so" "${serverfiles}/System/libvstdlib_s.so"
  82. elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" ]; then
  83. cp "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" "${serverfiles}/System/libvstdlib_s.so"
  84. fi
  85. fn_fix_msg_end
  86. fi
  87. # if running install command
  88. if [ "${commandname}" == "INSTALL" ]; then
  89. echo -e "applying server name fix."
  90. fn_sleep_time
  91. echo -e "forcing server restart..."
  92. fn_sleep_time
  93. exitbypass=1
  94. command_start.sh
  95. fn_firstcommand_reset
  96. fn_sleep_time_5
  97. exitbypass=1
  98. command_stop.sh
  99. fn_firstcommand_reset
  100. exitbypass=1
  101. command_start.sh
  102. fn_firstcommand_reset
  103. fn_sleep_time_5
  104. exitbypass=1
  105. command_stop.sh
  106. fn_firstcommand_reset
  107. fi