fn_glibcfix 4.3 KB

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