4
0

core_legacy.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. # LinuxGSM core_legacy.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Code for backwards compatibility with older versions of LinuxGSM.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. if [ -z "${socketname}" ]; then
  9. socketname="${sessionname}"
  10. fi
  11. if [ -n "${webadminuser}" ]; then
  12. httpuser="${webadminuser}"
  13. fi
  14. if [ -n "${webadminpass}" ]; then
  15. httppassword="${webadminpass}"
  16. fi
  17. if [ -n "${webadminport}" ]; then
  18. httpport="${webadminport}"
  19. fi
  20. if [ -n "${webadminip}" ]; then
  21. httpip="${webadminip}"
  22. fi
  23. if [ -n "${gameworld}" ]; then
  24. worldname="${gameworld}"
  25. fi
  26. if [ -n "${autosaveinterval}" ]; then
  27. saveinterval="${autosaveinterval}"
  28. fi
  29. if [ "${shortname}" == "st" ]; then
  30. if [ -n "${worldname}" ]; then
  31. worldsave="${worldname}"
  32. fi
  33. fi
  34. # Added as part of migrating functions dir to modules dir.
  35. # Will remove functions dir if files in modules dir older than 14 days
  36. functionsdir="${lgsmdir}/modules"
  37. if [ -d "${lgsmdir}/functions" ]; then
  38. if [ "$(find "${lgsmdir}/modules"/ -type f -mtime +"14" | wc -l)" -ne "0" ]; then
  39. rm -rf "${lgsmdir:?}/functions"
  40. fi
  41. fi
  42. fn_parms() {
  43. fn_reload_startparameters
  44. parms="${startparameters}"
  45. }