start_linux.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. if [ -d ${current_dir}/local/update ]; then
  9. for D in commons configSample localSample jvm servers store config local; do
  10. if [ ! -d ${current_dir}/$D ]; then
  11. mkdir ${current_dir}/commons
  12. fi
  13. done
  14. if [ -f ${current_dir}/local/update/o2server/version.o2 ]; then
  15. echo 'update o2server.'
  16. for D in commons configSample localSample jvm servers store; do
  17. if [ -d ${current_dir}/local/update/o2server/$D ]; then
  18. echo "update ${current_dir}/$D."
  19. cp -Rf -p ${current_dir}/local/update/o2server/$D ${current_dir}/
  20. fi
  21. done
  22. for F in console.jar index.html src.zip; do
  23. if [ -f ${current_dir}/local/update/o2server/$F ]; then
  24. echo "update ${current_dir}/$F."
  25. cp -f -p ${current_dir}/local/update/o2server/$F ${current_dir}/
  26. fi
  27. done
  28. for A in "start" "stop" "restart" "console" "service"; do
  29. 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
  30. if [ -f ${current_dir}/local/update/o2server/$A$B ]; then
  31. echo "update ${current_dir}/$A$B."
  32. cp -f -p ${current_dir}/local/update/o2server/$A$B ${current_dir}/
  33. fi
  34. done
  35. done
  36. echo "update ${current_dir}/version.o2."
  37. cp ${current_dir}/local/update/o2server/version.o2 ${current_dir}/
  38. echo "clean local/update directory."
  39. rm -Rf ${current_dir}/local/update
  40. echo "the update is complete, please restart the server."
  41. exit 1
  42. fi
  43. fi
  44. setsid ${current_dir}/jvm/linux_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