fn_install_glibcfix 4.6 KB

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