WhereAmI/old/start.sh
2026-06-15 00:49:26 +08:00

47 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "========================================"
echo "WhereAmI - 多协议轮转代理工具"
echo "========================================"
echo ""
# 检查Python环境
echo "正在检查Python环境..."
if ! command -v python3 &> /dev/null; then
echo "[错误] 未找到Python3请先安装Python 3.9+"
exit 1
fi
PYTHON_VERSION=$(python3 --version | awk '{print $2}' | cut -d. -f1,2)
echo "[成功] Python版本: $PYTHON_VERSION"
echo ""
# 检查依赖包
echo "正在检查依赖包..."
python3 -c "import PyQt6, requests, bs4, yaml, socks, loguru" 2>/dev/null
if [ $? -ne 0 ]; then
echo "[提示] 正在安装依赖包..."
pip3 install -r requirements.txt
if [ $? -ne 0 ]; then
echo "[错误] 依赖安装失败"
exit 1
fi
echo "[成功] 依赖安装完成"
else
echo "[成功] 依赖包已安装"
fi
echo ""
echo "========================================"
echo "启动 WhereAmI..."
echo "========================================"
echo ""
python3 main.py
if [ $? -ne 0 ]; then
echo ""
echo "[错误] 程序异常退出请查看logs/whereami.log"
exit 1
fi