fix_dst.sh 1.2 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # LinuxGSM fix_dst.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Resolves issues with Don't Starve Together.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer).
  9. # Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS.
  10. if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" ]; then
  11. fixname="libcurl-gnutls.so.4"
  12. fn_fix_msg_start
  13. ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/lib32/libcurl-gnutls.so.4"
  14. fn_fix_msg_end
  15. fi
  16. # Keeps shard name in server.ini the same as in the LinuxGSM config.
  17. if [ -f "${servercfgfullpath}" ]; then
  18. if [ "$(grep -Ec '^name[[:space:]]*=' "${servercfgfullpath}")" -eq 1 ]; then
  19. if [ "$(grep -E '^name[[:space:]]*=' "${servercfgfullpath}" | cut -d '=' -f2 | tr -d '"' | tr -d ' ')" != "${shard}" ]; then
  20. fixname="update server.ini shard name"
  21. fn_fix_msg_start
  22. sed -i -e "s/name[[:space:]]*=.*/name = \"${shard}\"/g" "${servercfgfullpath}"
  23. fn_fix_msg_end
  24. fi
  25. fi
  26. fi