fix_glibc.sh 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #!/bin/bash
  2. # LGSM fix_glibc.sh function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="020116"
  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. echo ""
  21. echo "http://gameservermanagers.com/glibcfix"
  22. sleep 1
  23. echo ""
  24. echo -en "loading required files.\r"
  25. sleep 1
  26. echo -en "loading required files..\r"
  27. sleep 1
  28. echo -en "loading required files...\r"
  29. sleep 1
  30. echo -en "\n"
  31. }
  32. # if ldd command not detected
  33. if [ -z $(command -v ldd) ]; then
  34. echo ""
  35. fn_printfailurenl "GLIBC is not detected"
  36. sleep 1
  37. echo "Install GLIBC and retry installation."
  38. sleep 1
  39. echo ""
  40. while true; do
  41. read -e -i "y" -p "Continue install? [Y/n]" yn
  42. case $yn in
  43. [Yy]* ) break;;
  44. [Nn]* ) echo Exiting; exit;;
  45. * ) echo "Please answer yes or no.";;
  46. esac
  47. done
  48. # if Glibc less than 1.15
  49. elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 215 ]; then
  50. # Blade Symphony
  51. if [ "${gamename}" == "Blade Symphony" ]; then
  52. glibcversion="2.15"
  53. fn_glibcfixmsg
  54. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  55. # Dont Starve Together
  56. elif [ "${gamename}" == "Don't Starve Together" ]; then
  57. glibcversion="2.15"
  58. fn_glibcfixmsg
  59. cd "${filesdir}/bin/lib32/"
  60. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/DontStarveTogether/dependencies/libc.so.6
  61. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/DontStarveTogether/dependencies/libpthread.so.0
  62. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/DontStarveTogether/dependencies/librt.so.1
  63. # Double Action: Boogaloo
  64. elif [ "${gamename}" == "Double Action: Boogaloo" ]; then
  65. glibcversion="2.15"
  66. fn_glibcfixmsg
  67. cd "${filesdir}"
  68. wget -nv -N https://github.com/dgibbs64/linuxgsm/blob/master/DoubleActionBoogaloo/dependencies/libm.so.6
  69. # Fistful of Frags
  70. elif [ "${gamename}" == "Fistful of Frags" ]; then
  71. glibcversion="2.15"
  72. fn_glibcfixmsg
  73. cd "${filesdir}"
  74. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/FistfulOfFrags/dependencies/libm.so.6
  75. # Garry's Mod
  76. elif [ "${gamename}" == "Garry's Mod" ]; then
  77. glibcversion="2.15"
  78. fn_glibcfixmsg
  79. cd "${filesdir}/bin"
  80. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libc.so.6
  81. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libm.so.6
  82. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libpthread.so.0
  83. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  84. # Insurgency
  85. elif [ "${gamename}" == "Insurgency" ]; then
  86. glibcversion="2.15"
  87. fn_glibcfixmsg
  88. cd "${filesdir}/bin"
  89. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libc.so.6
  90. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libm.so.6
  91. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/librt.so.1
  92. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libpthread.so.0
  93. elif [ "${gamename}" == "Left 4 Dead" ]; then
  94. glibcversion="2.3.6"
  95. fn_glibcfixmsg
  96. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/bin/libstdc++.so.6"
  97. # Natural Selection 2
  98. elif [ "${gamename}" == "Natural Selection 2" ]; then
  99. glibcversion="2.15"
  100. fn_glibcfixmsg
  101. cd "${filesdir}"
  102. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NaturalSelection2/dependencies/libm.so.6
  103. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  104. # NS2: Combat
  105. elif [ "${gamename}" == "NS2: Combat" ]; then
  106. glibcversion="2.15"
  107. fn_glibcfixmsg
  108. cd "${filesdir}"
  109. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NS2Combat/dependencies/libm.so.6
  110. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  111. # No More Room in Hell
  112. elif [ "${gamename}" == "No More Room in Hell" ]; then
  113. glibcversion="2.15"
  114. fn_glibcfixmsg
  115. cd "${filesdir}"
  116. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
  117. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  118. # if Glibc less than 1.13
  119. elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 213 ]; then
  120. # ARMA 3
  121. if [ "${gamename}" == "ARMA 3" ]; then
  122. glibcversion="2.13"
  123. fn_glibcfixmsg
  124. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  125. # Just Cause 2
  126. elif [ "${gamename}" == "Just Cause 2" ]; then
  127. glibcversion="2.13"
  128. fn_glibcfixmsg
  129. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  130. # Serious Sam 3: BFE
  131. elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
  132. glibcversion="2.13"
  133. fn_glibcfixmsg
  134. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/Bin/libstdc++.so.6"
  135. else
  136. : # Else glibcfix not required.
  137. fi
  138. else
  139. : #Else glibcfix not required.
  140. fi
  141. fi
  142. sleep 1