core_legacy.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 compatability 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. # Added as part of migrating functions dir to modules dir.
  30. # Will remove functions dir if files in modules dir older than 14 days
  31. functionsdir="${lgsmdir}/modules"
  32. if [ -d "${lgsmdir}/functions" ]; then
  33. if [ "$(find "${lgsmdir}/modules"/ -type f -mtime +"14" | wc -l)" -ne "0" ]; then
  34. rm -rf "${lgsmdir:?}/functions"
  35. fi
  36. fi
  37. fn_parms() {
  38. fn_reload_startparameters
  39. parms="${startparameters}"
  40. }