fn_glibcfix 3.4 KB

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