fix_rust.sh 1.0 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # LinuxGSM fix_rust.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Resolves startup issue with Rust.
  7. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # Fixes: [Raknet] Server Shutting Down (Shutting Down).
  9. export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64"
  10. # Part of random seed feature.
  11. # If seed is not defined by user generate a seed file.
  12. if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then
  13. if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then
  14. shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt"
  15. fi
  16. seed="$(cat "${datadir}/${selfname}-seed.txt")"
  17. randomseed=1
  18. fi
  19. # If Carbon mod is installed, run enviroment.sh
  20. if [ -f "${serverfiles}/carbon/tools/environment.sh" ]; then
  21. fn_print_info_nl "Running Carbon environment.sh"
  22. fn_script_log_info "Running Carbon environment.sh"
  23. # shellcheck source=/dev/null
  24. source "${serverfiles}/carbon/tools/environment.sh"
  25. fi