install_mta_resources.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # LinuxGSM install_mta_resources.sh function
  3. # Author: Daniel Gibbs
  4. # Contributor: ChaosMTA
  5. # Website: https://gameservermanagers.com
  6. # Description: Installs the libmysqlclient for database functions on the server and optionally installs default resources required to run the server
  7. local commandname="INSTALL"
  8. local commandaction="Install"
  9. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  10. fn_install_libmysqlclient16(){
  11. echo ""
  12. echo "Checking if libmysqlclient16 is installed"
  13. echo "================================="
  14. sleep 1
  15. if [ ! -f "/usr/lib/libmysqlclient.so.16" ]; then
  16. fn_print_warn_nl "libmysqlclient16 not installed. Installing.."
  17. sleep 1
  18. sudo -v > /dev/null 2>&1
  19. if [ $? -eq 0 ]; then
  20. fn_fetch_file "https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16" "${filedir}" "libmysqlclient.so.16" "executecmd" "norun" "noforce" "6c188e0f8fb5d7a29f4bc413b9fed6c2"
  21. sudo mv "${tmpdir}/libmysqlclient.so.16" "/usr/lib/libmysqlclient.so.16"
  22. else
  23. fn_print_fail_nl "Failed to install libmysqlclient16, $(whoami) does not have sudo access. Download it manually and place it in /usr/lib"
  24. sleep 1
  25. fi
  26. else
  27. echo "libmysqlclient16 already installed."
  28. fi
  29. }
  30. fn_install_libmysqlclient16
  31. fn_print_information_nl "Server is inoperable by default without resources, you can install default ones by running the command install-default-resources"
  32. echo ""