check_glibc.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # LGSM check_glibc.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Checks if server has correct glibc or has a fix available.
  6. local modulename="Checking"
  7. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  8. info_glibc.sh
  9. info_distro.sh
  10. if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
  11. :
  12. elif [ "${glibcrequired}" == "UNKNOWN" ]; then
  13. fn_print_info_nl "Glibc fix: \e[0;31m${glibcrequired}\e[0m"
  14. echo -e " * glibc required: \e[0;31m${glibcrequired}\e[0m"
  15. echo -e " * glibc installed: ${glibcversion}"
  16. elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
  17. if [ "${glibcfix}" == "yes" ]; then
  18. if [ "${function_selfname}" != "command_install.sh" ]; then
  19. fn_print_info_nl "Glibc fix: \e[0;32mUsing Glibc fix\e[0m"
  20. echo -e " * glibc required: \e[0;31m${glibcrequired}\e[0m"
  21. echo -e " * glibc installed: ${glibcversion}"
  22. fix_glibc.sh
  23. fi
  24. else
  25. fn_print_warn_nl "Glibc fix: \e[0;31mNo Glibc fix available!\e[0m"
  26. echo -en "\n"
  27. echo -e " * glibc required: ${glibcrequired}"
  28. echo -e " * glibc installed: \e[0;31m${glibcversion}\e[0m"
  29. echo -en "\n"
  30. fn_print_infomation "The game server will probably not work. A distro upgrade is required!"
  31. sleep 5
  32. fi
  33. fi