check_glibc.sh 1.4 KB

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