fn_install_glibcfix 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #!/bin/bash
  2. # LGSM fn_install_glibcfix function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="061115"
  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. # Double Action: Boogaloo
  56. elif [ "${gamename}" == "Double Action: Boogaloo" ]; then
  57. glibcversion="2.15"
  58. fn_glibcfixmsg
  59. cd "${filesdir}"
  60. wget -nv -N https://github.com/dgibbs64/linuxgsm/blob/master/DoubleActionBoogaloo/dependencies/libm.so.6
  61. # Fistful of Frags
  62. elif [ "${gamename}" == "Fistful of Frags" ]; then
  63. glibcversion="2.15"
  64. fn_glibcfixmsg
  65. cd "${filesdir}"
  66. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/FistfulOfFrags/dependencies/libm.so.6
  67. # Garry's Mod
  68. elif [ "${gamename}" == "Garry's Mod" ]; then
  69. glibcversion="2.15"
  70. fn_glibcfixmsg
  71. cd "${filesdir}/bin"
  72. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libc.so.6
  73. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libm.so.6
  74. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libpthread.so.0
  75. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  76. # Insurgency
  77. elif [ "${gamename}" == "Insurgency" ]; then
  78. glibcversion="2.15"
  79. fn_glibcfixmsg
  80. cd "${filesdir}/bin"
  81. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libc.so.6
  82. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libm.so.6
  83. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/librt.so.1
  84. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libpthread.so.0
  85. elif [ "${gamename}" == "Left 4 Dead" ]; then
  86. glibcversion="2.07"
  87. fn_glibcfixmsg
  88. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/bin/libstdc++.so.6"
  89. # Natural Selection 2
  90. elif [ "${gamename}" == "Natural Selection 2" ]; then
  91. glibcversion="2.15"
  92. fn_glibcfixmsg
  93. cd "${filesdir}"
  94. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NaturalSelection2/dependencies/libm.so.6
  95. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  96. # NS2: Combat
  97. elif [ "${gamename}" == "NS2: Combat" ]; then
  98. glibcversion="2.15"
  99. fn_glibcfixmsg
  100. cd "${filesdir}"
  101. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NS2Combat/dependencies/libm.so.6
  102. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  103. # No More Room in Hell
  104. elif [ "${gamename}" == "No More Room in Hell" ]; then
  105. glibcversion="2.15"
  106. fn_glibcfixmsg
  107. cd "${filesdir}"
  108. wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
  109. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  110. # if Glibc less than 1.13
  111. elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 213 ]; then
  112. # ARMA 3
  113. if [ "${gamename}" == "ARMA 3" ]; then
  114. glibcversion="2.13"
  115. fn_glibcfixmsg
  116. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  117. # Just Cause 2
  118. elif [ "${gamename}" == "Just Cause 2" ]; then
  119. glibcversion="2.13"
  120. fn_glibcfixmsg
  121. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
  122. # Serious Sam 3: BFE
  123. elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
  124. glibcversion="2.13"
  125. fn_glibcfixmsg
  126. cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/Bin/libstdc++.so.6"
  127. else
  128. : # Else glibcfix not required.
  129. fi
  130. else
  131. : #Else glibcfix not required.
  132. fi
  133. fi
  134. sleep 1