智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
626 B

#!/bin/bash
# start-claude-v2ray.sh
echo "检查 V2Ray 是否运行..."
if ! pgrep -x "v2ray" > /dev/null; then
echo "启动 V2Ray..."
nohup v2ray run -config config.json > /tmp/v2ray.log 2>&1 &
sleep 3
fi
echo "设置代理: 127.0.0.1:1087"
export HTTP_PROXY=http://127.0.0.1:1087
export HTTPS_PROXY=http://127.0.0.1:1087
# 测试连接
echo "测试代理连接..."
if curl --proxy $HTTP_PROXY --max-time 10 -s https://api.anthropic.com > /dev/null; then
echo "✅ 代理连接正常"
echo "启动 Claude Code..."
claude
else
echo "❌ 代理连接失败,请检查 V2Ray 配置"
exit 1
fi