fn_install_glibcfix 4.3 KB

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