wkcrm.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/sh
  2. #chkconfig: 2345 80 05
  3. #description: wkcrm
  4. #author: hmb
  5. server_names=('gateway' 'work' 'oa' 'authorization' 'admin' 'bi' 'crm' 'job' 'examine' 'hrm')
  6. echo "等待mysql和nacos启动..."
  7. sleep 180s
  8. case "$1" in
  9. start)
  10. # shellcheck disable=SC2164
  11. cd /opt
  12. echo "启动seata"
  13. nohup sh seata/bin/seata-server.sh > package/logs/seata.log 2>&1 &
  14. # shellcheck disable=SC2039
  15. for value in "${server_names[@]}"
  16. do
  17. # shellcheck disable=SC2164
  18. cd /opt/package/$value
  19. sh 72crm.sh start
  20. sleep 10s;
  21. done
  22. echo "wkcrm startup"
  23. tail -f /dev/null
  24. ;;
  25. stop)
  26. # shellcheck disable=SC2164
  27. cd /opt
  28. # shellcheck disable=SC2039
  29. for value in "${server_names[@]}"
  30. do
  31. sh package/$value/72crm.sh stop;
  32. sleep 0.5s;
  33. done
  34. ;;
  35. restart)
  36. # shellcheck disable=SC2164
  37. cd /opt
  38. # shellcheck disable=SC2039
  39. for value in "${server_names[@]}"
  40. do
  41. sh package/$value/72crm.sh stop;
  42. sleep 0.5s;
  43. done
  44. echo "启动seata"
  45. nohup sh seata/bin/seata-server.sh > package/logs/seata.log 2>&1 &
  46. for value in "${server_names[@]}"
  47. do
  48. # shellcheck disable=SC2164
  49. cd /opt/package/$value
  50. sh 72crm.sh start
  51. sleep 10s;
  52. done
  53. echo "wkcrm startup"
  54. tail -f /dev/null
  55. ;;
  56. *)
  57. echo "start|stop|restart"
  58. ;;
  59. esac
  60. exit $?