fix_vh.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. # LinuxGSM fix_rust.sh module
  3. # Author: Alasdair Haig
  4. # Website: https://linuxgsm.com
  5. # Description: Resolves startup issue with Valheim
  6. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  7. export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
  8. modsdir="${lgsmdir}/mods"
  9. modsinstalledlistfullpath="${modsdir}/installed-mods.txt"
  10. if [ -f "${modsinstalledlistfullpath}" ]; then
  11. # special check if Valheim Plus is installed
  12. if grep -qE "^valheimplus" "${modsinstalledlistfullpath}"; then
  13. if ! grep -qE "^executable=\"./start_server_bepinex.sh\"" "${configdirserver}/${selfname}.cfg"; then
  14. echo 'executable="./start_server_bepinex.sh"' >> "${configdirserver}/${selfname}.cfg"
  15. executable="./start_server_bepinex.sh"
  16. fi
  17. fi
  18. # special exports for BepInEx if installed
  19. if grep -qE "^bepinexvh" "${modsinstalledlistfullpath}"; then
  20. fn_print_info_nl "BepInEx install detected, applying start exports"
  21. fn_script_log_info "BepInEx install detected, applying start exports"
  22. # exports for BepInEx framework from script start_server_bepinex.sh
  23. export DOORSTOP_ENABLE=TRUE
  24. export DOORSTOP_INVOKE_DLL_PATH=./BepInEx/core/BepInEx.Preloader.dll
  25. export DOORSTOP_CORLIB_OVERRIDE_PATH=./unstripped_corlib
  26. export LD_LIBRARY_PATH="./doorstop_libs:${LD_LIBRARY_PATH}"
  27. export LD_PRELOAD="libdoorstop_x64.so:${LD_PRELOAD}"
  28. export SteamAppId=892970
  29. fi
  30. fi