graalvm.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. # Copyright (c) http://www.o2oa.net/
  3. current_dir="$(cd "$(dirname "$0")"; pwd)"
  4. if [ -d ${current_dir}/local/update ]
  5. then
  6. for D in commons configSample localSample jvm servers store config local
  7. do
  8. if [ ! -d ${current_dir}/$D ]
  9. then
  10. mkdir ${current_dir}/commons
  11. fi
  12. done
  13. if [ -f ${current_dir}/local/update/o2server/version.o2 ]
  14. then
  15. echo 'update o2server.'
  16. for D in commons configSample localSample jvm servers store
  17. do
  18. if [ -d ${current_dir}/local/update/o2server/$D ]
  19. then
  20. echo "update ${current_dir}/$D."
  21. cp -Rf -p ${current_dir}/local/update/o2server/$D ${current_dir}/
  22. fi
  23. done
  24. for F in console.jar index.html src.zip
  25. do
  26. if [ -f ${current_dir}/local/update/o2server/$F ]
  27. then
  28. echo "update ${current_dir}/$F."
  29. cp -f -p ${current_dir}/local/update/o2server/$F ${current_dir}/
  30. fi
  31. done
  32. for A in "start" "stop" "restart" "console" "service"
  33. do
  34. for B in "_windows.bat" "_linux.sh" "_macos.sh" "_arm.sh" "_mips.sh" "_raspi.sh" "_aix.sh"
  35. do
  36. if [ -f ${current_dir}/local/update/o2server/$A$B ]; then
  37. echo "update ${current_dir}/$A$B."
  38. cp -f -p ${current_dir}/local/update/o2server/$A$B ${current_dir}/
  39. fi
  40. done
  41. done
  42. echo "update ${current_dir}/version.o2."
  43. cp ${current_dir}/local/update/o2server/version.o2 ${current_dir}/
  44. echo "clean local/update directory."
  45. rm -Rf ${current_dir}/local/update
  46. echo "the update is complete, please restart the server."
  47. exit 1
  48. fi
  49. fi
  50. setsid /home/ray/Coding/Java/jvm/graalvm-java17/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 -XX:+PrintFlagsFinal -Xms256m -Xmx1024m -Duser.timezone=GMT+08 -XX:+HeapDumpOnOutOfMemoryError -jar ${current_dir}/console.jar