core_legacy.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. # LinuxGSM core_legacy.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.com
  5. # Description: Code for backwards compatability with older versions of LinuxGSM.
  6. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  7. if [ -z "${serverfiles}" ]; then
  8. legacymode=1
  9. serverfiles="${filesdir}"
  10. fi
  11. if [ -z "${logdir}" ]; then
  12. logdir="${rootdir}/log"
  13. fi
  14. if [ -z "${lgsmlogdir}" ]; then
  15. lgsmlogdir="${scriptlogdir}"
  16. fi
  17. if [ -z "${lgsmlog}" ]; then
  18. lgsmlog="${scriptlog}"
  19. fi
  20. if [ -z "${lgsmlogdate}" ]; then
  21. lgsmlogdate="${scriptlogdate}"
  22. fi
  23. if [ -z "${steamcmddir}" ]; then
  24. steamcmddir="${HOME}/.steam/steamcmd"
  25. fi
  26. if [ -z "${lgsmdir}" ]; then
  27. lgsmdir="${rootdir}/lgsm"
  28. fi
  29. if [ -z "${tmpdir}" ]; then
  30. tmpdir="${lgsmdir}/tmp"
  31. fi
  32. if [ -z "${alertlog}" ]; then
  33. alertlog="${emaillog}"
  34. fi
  35. if [ -z "${servicename}" ]; then
  36. servicename="${selfname}"
  37. fi
  38. # Alternations to workshop variables.
  39. if [ -z "${wsapikey}" ]; then
  40. if [ "${workshopauth}" ]; then
  41. wsapikey="${workshopauth}"
  42. elif [ "${authkey}" ]; then
  43. wsapikey="${authkey}"
  44. fi
  45. fi
  46. if [ -z "${wscollectionid}" ]; then
  47. if [ "${workshopauth}" ]; then
  48. wscollectionid="${ws_collection_id}"
  49. elif [ "${authkey}" ]; then
  50. wscollectionid="${workshopcollectionid}"
  51. fi
  52. fi
  53. if [ -z "${wsstartmap}" ]; then
  54. if [ "${ws_start_map}" ]; then
  55. wscollectionid="${ws_start_map}"
  56. fi
  57. fi