start_macosarm.sh 2.1 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" "_windows_debug.bat" "_linux.sh" "_linux_debug.sh" "_linux_min.sh" "_macosx64.sh" "_macosx64_debug.sh" "_macosarm.sh" "_macosarm_debug.sh" "_arm.sh" "_arm_debug.sh" "_mips.sh" "_mips_debug.sh" "_raspi.sh" "_raspi_debug.sh" "_sw.sh" "_sw_debug.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/macosarm_java11/bin/java -javaagent:${current_dir}/console.jar -server -Djava.awt.headless=true -Xms2g -Xmx4g -Duser.timezone=GMT+08 -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI --module-path=${current_dir}/commons/module_java11 --upgrade-module-path=${current_dir}/commons/module_java11/compiler.jar:${current_dir}/commons/module_java11/compiler-management.jar -jar ${current_dir}/console.jar