fix_rust.sh 722 B

123456789101112131415161718192021
  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}" ]; 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