install.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # 设置工作目录为脚本所在的目录
  3. cd "$(dirname "$0")" || exit 1
  4. # 引入依赖脚本
  5. source scripts/lib.sh
  6. # 信号处理
  7. trap 'rm -f .env; exit' SIGINT SIGTSTP SIGTERM
  8. # 清理不需要的文件
  9. clean_files
  10. # 安装依赖
  11. print_message "Checking server environment..." "检查服务器环境..."
  12. install_dependencies
  13. # 检查环境
  14. print_message "Checking the panel environment..." "检查面板运行环境..."
  15. check_env
  16. # 设置权限
  17. print_message "Setting Folder Permissions..." "设置文件夹权限..."
  18. set_permissions
  19. # 检查Composer
  20. print_message "Checking Composer..." "检查Composer..."
  21. check_composer
  22. # 执行Composer安装
  23. print_message "Installing packages via Composer..." "通过Composer安装程序包..."
  24. composer install --no-interaction --no-dev --optimize-autoloader
  25. # 执行Panel安装
  26. php artisan panel:install
  27. # 设置定时任务
  28. print_message "Enabling Panel schedule tasks..." "开启面板定时任务..."
  29. set_schedule
  30. # 设置Horizon
  31. print_message "Setting Horizon daemon..." "设置Horizon守护程序..."
  32. set_horizon
  33. # 下载IP数据库文件
  34. print_message "Downloading IP database files..." "下载IP数据库文件..."
  35. cd scripts/ && bash download_dbs.sh