check_glibc.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 commandnane="CHECK"
  7. local commandaction="Checking"
  8. # Cannot have selfname as breaks the function.
  9. #local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  10. info_glibc.sh
  11. info_distro.sh
  12. if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
  13. :
  14. elif [ "${glibcrequired}" == "UNKNOWN" ]; then
  15. fn_print_info_nl "Glibc fix: ${red}${glibcrequired}${default}"
  16. echo -e " * glibc required: ${red}${glibcrequired}${default}"
  17. echo -e " * glibc installed: ${glibcversion}"
  18. elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
  19. if [ "${glibcfix}" == "yes" ]; then
  20. if [ "${selfname}" != "command_install.sh" ]; then
  21. fn_print_info_nl "Glibc fix: ${green}Using Glibc fix${default}"
  22. echo -e " * glibc required: ${red}${glibcrequired}${default}"
  23. echo -e " * glibc installed: ${glibcversion}"
  24. fix_glibc.sh
  25. fi
  26. else
  27. fn_print_warn_nl "Glibc fix: ${red}No Glibc fix available!${default}"
  28. echo -en "\n"
  29. echo -e " * glibc required: ${glibcrequired}"
  30. echo -e " * glibc installed: ${red}${glibcversion}${default}"
  31. echo -en "\n"
  32. fn_print_infomation "The game server will probably not work. A distro upgrade is required!"
  33. sleep 5
  34. fi
  35. fi