check_glibc.sh 1.5 KB

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