init.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. set -e
  3. GREEN='\033[0;32m'
  4. BLUE='\033[0;34m'
  5. YELLOW='\033[0;33m'
  6. # shellcheck disable=SC2039
  7. echo -e "${BLUE}一些常用的命令脚本:${NC}"
  8. echo -e "${GREEN}查看所有服务状态${NC}"
  9. # shellcheck disable=SC2039
  10. echo -e "${GREEN}sudo systemctl status server.service game.service${NC}"
  11. # shellcheck disable=SC2039
  12. echo -e "${GREEN}重启后端服务${NC}"
  13. # shellcheck disable=SC2039
  14. echo -e "${GREEN}sudo systemctl restart server.service${NC}"
  15. # shellcheck disable=SC2039
  16. echo -e "${GREEN}重启游戏服务器${NC}"
  17. # shellcheck disable=SC2039
  18. echo -e "${GREEN}sudo systemctl restart game.service${NC}"
  19. # shellcheck disable=SC2039
  20. echo -e "${GREEN}监听后端服务实时日志${NC}"
  21. # shellcheck disable=SC2039
  22. echo -e "${GREEN}sudo journalctl -fu server.service${NC}"
  23. # shellcheck disable=SC2039
  24. echo -e "${GREEN}监听游戏服务器实时日志${NC}"
  25. # shellcheck disable=SC2039
  26. echo -e "${GREEN}sudo journalctl -fu game.service${NC}"
  27. # shellcheck disable=SC2039
  28. echo -e "${GREEN}重启Nginx服务${NC}"
  29. # shellcheck disable=SC2039
  30. echo -e "${GREEN}sudo systemctl restart nginx.service${NC}"
  31. # shellcheck disable=SC2039