fix_ts3.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # LinuxGSM fix_ts3.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Resolves various issues with Teamspeak 3.
  7. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # Fixes: makes libmariadb2 available #1924.
  9. if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then
  10. fixname="libmariadb.so.2"
  11. fn_fix_msg_start
  12. cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}/libmariadb.so.2"
  13. fn_fix_msg_end
  14. fi
  15. # Fixes: failed to register local accounting service: No such file or directory.
  16. accountingfile="/dev/shm/7gbhujb54g8z9hu43jre8"
  17. if [ -f "${accountingfile}" ] && [ "${status}" == "0" ]; then
  18. # Check permissions for the file if the current user owns it, if not exit.
  19. if [ "$(stat -c %U ${accountingfile})" == "$(whoami)" ]; then
  20. fixname="Delete file ${accountingfile}"
  21. fn_fix_msg_start
  22. rm -f "${accountingfile}"
  23. fn_fix_msg_end
  24. # file is not owned by the current user and needs to be deleted manually.
  25. else
  26. fn_print_error_nl "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually"
  27. fn_script_log_fatal "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually"
  28. core_exit.sh
  29. fi
  30. fi