init.sh 889 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. # 先克隆 shell-kit 仓库(如果不存在)
  3. echo ""
  4. if [ ! -d "/workspace/shell-kit" ]; then
  5. if git clone root@git.ooo.ink:root/shell-kit.git /workspace/shell-kit; then
  6. echo "✅ shell-kit 仓库克隆完成"
  7. else
  8. echo "❌ shell-kit 仓库克隆失败"
  9. exit 1
  10. fi
  11. else
  12. echo "✅ shell-kit 仓库已存在,跳过克隆"
  13. fi
  14. echo ""
  15. # 配置 SSH 服务
  16. echo ""
  17. if [ -f "/workspace/shell-kit/setup-ssh.sh" ]; then
  18. chmod +x /workspace/shell-kit/setup-ssh.sh
  19. /workspace/shell-kit/setup-ssh.sh
  20. else
  21. echo "⚠️ 警告:SSH 配置脚本不存在,跳过 SSH 配置"
  22. fi
  23. echo ""
  24. # 安装 trunk 工具并初始化
  25. echo ""
  26. if [ -f "/workspace/shell-kit/setup-trunk.sh" ]; then
  27. chmod +x /workspace/shell-kit/setup-trunk.sh
  28. /workspace/shell-kit/setup-trunk.sh
  29. else
  30. echo "⚠️ 警告:trunk 安装脚本不存在,跳过 trunk 安装和初始化"
  31. fi
  32. echo ""