fix_ins.sh 989 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # LinuxGSM fix_ins.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Resolves issues with Insurgency.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # Fixes: ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory.
  9. export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/bin"
  10. # Fixes: issue #529 - gamemode not passed to debug or start.
  11. if [ "${commandname}" == "DEBUG" ]; then
  12. defaultmap="\"${defaultmap}\""
  13. else
  14. defaultmap="\\\"${defaultmap}\\\""
  15. fi
  16. # Fixes: srcds_run is shipped with CRLF line endings and a /bin/sh shebang but needs bash (pushd/popd).
  17. if [ -f "${serverfiles}/srcds_run" ]; then
  18. if grep -q $'\r' "${serverfiles}/srcds_run" || head -n 1 "${serverfiles}/srcds_run" | grep -q '^#!/bin/sh'; then
  19. sed -i 's/\r$//;1s|^#!/bin/sh$|#!/bin/bash|' "${serverfiles}/srcds_run"
  20. fi
  21. fi