start_macos.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # Copyright (c) http://www.o2oa.net/
  3. current_dir="$(
  4. cd "$(dirname "$0")"
  5. pwd
  6. )"
  7. cd ${current_dir}
  8. sudo date
  9. if [ -d ${current_dir}/local/update ]; then
  10. for D in commons configSample localSample jvm servers store config local; do
  11. if [ ! -d ${current_dir}/$D ]; then
  12. mkdir ${current_dir}/commons
  13. fi
  14. done
  15. if [ -f ${current_dir}/local/update/o2server/version.o2 ]; then
  16. echo 'update o2server.'
  17. for D in commons configSample localSample jvm servers store; do
  18. if [ -d ${current_dir}/local/update/o2server/$D ]; then
  19. echo "update ${current_dir}/$D."
  20. cp -Rf -p ${current_dir}/local/update/o2server/$D ${current_dir}/
  21. fi
  22. done
  23. for F in console.jar index.html src.zip; do
  24. if [ -f ${current_dir}/local/update/o2server/$F ]; then
  25. echo "update ${current_dir}/$F."
  26. cp -f -p ${current_dir}/local/update/o2server/$F ${current_dir}/
  27. fi
  28. done
  29. for A in "start" "stop" "restart" "console" "service"; do
  30. for B in "_windows.bat" "_linux.sh" "_linux_min.sh" "_macos.sh" "_arm.sh" "_mips.sh" "_raspi.sh" "_aix.sh"; do
  31. if [ -f ${current_dir}/local/update/o2server/$A$B ]; then
  32. echo "update ${current_dir}/$A$B."
  33. cp -f -p ${current_dir}/local/update/o2server/$A$B ${current_dir}/
  34. fi
  35. done
  36. done
  37. echo "update ${current_dir}/version.o2."
  38. cp ${current_dir}/local/update/o2server/version.o2 ${current_dir}/
  39. echo "clean local/update directory."
  40. rm -Rf ${current_dir}/local/update
  41. echo "the update is complete, please restart the server."
  42. exit 1
  43. fi
  44. fi
  45. sudo ${current_dir}/jvm/macos_java11/bin/java -Dnashorn.args=--no-deprecation-warning --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.arrays=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -javaagent:${current_dir}/console.jar -server -Djava.awt.headless=true -Xms2g -Xmx4g -Duser.timezone=GMT+08 -XX:+HeapDumpOnOutOfMemoryError -jar ${current_dir}/console.jar