check_glibc.sh 1.2 KB

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