4
0

fix_rust.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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 issues with Rust.
  7. moduleselfname="$(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. seed="$(cat "${datadir}/${selfname}-seed.txt")"
  16. fn_print_info_nl "Generating new random seed (${cyan}${seed}${default})"
  17. fn_script_log_pass "Generating new random seed (${cyan}${seed}${default})"
  18. fi
  19. seed="$(cat "${datadir}/${selfname}-seed.txt")"
  20. randomseed=1
  21. fi
  22. # If Carbon mod is installed, run enviroment.sh
  23. if [ -f "${serverfiles}/carbon/tools/environment.sh" ]; then
  24. fn_print_info_nl "Running Carbon environment.sh"
  25. fn_script_log_info "Running Carbon environment.sh"
  26. # shellcheck source=/dev/null
  27. source "${serverfiles}/carbon/tools/environment.sh"
  28. fi