fn_glibcfix 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/bash
  2. # LGSM fn_glibcfix function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 121114
  6. fn_glibcfixmsg(){
  7. echo "Detected ${gamename}"
  8. sleep 1
  9. echo ""
  10. }
  11. if [ "${gamename}" == "Insurgency" ]||[ "${gamename}" == "Garrys's Mod" ]||[ "${gamename}" == "Natural Selection 2" ]||[ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Blade Symphony" ]||[ "${gamename}" == "Fistful of Frags" ]||[ "${gamename}" == "ARMA 3" ]; then
  12. if [ -z $(command -v ldd) ]; then
  13. echo ""
  14. echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected."
  15. sleep 1
  16. echo "Install GLIBC and retry installation"
  17. sleep 1
  18. echo ""
  19. while true; do
  20. read -p "Continue install? [y/N]" yn
  21. case $yn in
  22. [Yy]* ) break;;
  23. [Nn]* ) echo Exiting; exit;;
  24. * ) echo "Please answer yes or no.";;
  25. esac
  26. done
  27. elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 215 ]; then
  28. echo "GLIBC Fix required"
  29. echo "============================"
  30. sleep 1
  31. echo -e "\e[0;31mWARNING!\e[0;39m ${gamename} requires GLIBC_2.15 or above"
  32. sleep 1
  33. echo ""
  34. echo "Currently installed: GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')"
  35. echo "Required: => GLIBC_2.15"
  36. echo ""
  37. sleep 1
  38. echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with GLIBC_2.14 or less."
  39. echo "note: This will NOT upgrade GLIBC on your system"
  40. sleep 1
  41. echo ""
  42. echo "Downloading Required files"
  43. echo "================================="
  44. sleep 1
  45. if [ "${gamename}" == "Insurgency" ]; then
  46. fn_glibcfixmsg
  47. cd "${filesdir}/bin"
  48. wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libc.so.6
  49. wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/librt.so.1
  50. wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libpthread.so.0
  51. sleep 1
  52. elif [ "${gamename}" == "Garrys's Mod" ]; then
  53. fn_glibcfixmsg
  54. cd "${filesdir}/bin"
  55. wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
  56. wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
  57. wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
  58. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  59. sleep 1
  60. echo ""
  61. elif [ "${gamename}" == "Natural Selection 2" ]; then
  62. fn_glibcfixmsg
  63. cd "${filesdir}"
  64. wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NaturalSelection2/dependencies/libm.so.6
  65. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  66. sleep 1
  67. echo ""
  68. elif [ "${gamename}" == "No More Room in Hell" ]; then
  69. fn_glibcfixmsg
  70. cd "${filesdir}"
  71. wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
  72. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  73. sleep 1
  74. echo ""
  75. elif [ "${gamename}" == "Blade Symphony" ]; then
  76. fn_glibcfixmsg
  77. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  78. sleep 1
  79. echo ""
  80. elif [ "${gamename}" == "Fistful of Frags" ]; then
  81. echo "Detected ${gamename}"
  82. sleep 1
  83. echo "Downloading files for ${gamename} GLIBC Fix"
  84. sleep 1
  85. cd "${filesdir}"
  86. wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/FistfulOfFrags/dependencies/libm.so.6
  87. sleep 1
  88. echo ""
  89. elif [ "${gamename}" == "ARMA 3" ]; then
  90. fn_glibcfixmsg
  91. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  92. sleep 1
  93. echo ""
  94. else
  95. echo "error: Unable to detect game. Fix not applied"
  96. fi
  97. echo "GLIBC fix has been applied!"
  98. sleep 1
  99. echo ""
  100. fi
  101. else
  102. sleep 0.1
  103. fi