Skip to content

Instantly share code, notes, and snippets.

@Issac-v
Created June 28, 2023 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Issac-v/6019b3091670f484e186397a58ccb264 to your computer and use it in GitHub Desktop.
Save Issac-v/6019b3091670f484e186397a58ccb264 to your computer and use it in GitHub Desktop.
replit部署go-proxy-bingai, 理论其他平台可用
repo="adams549659584/go-proxy-bingai"
# 获取远程tag
tag=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -o '"tag_name": ".*"' | sed 's/"tag_name": "//;s/"//')
# 获取本地tag
if [ -f "cur_tag" ]; then
cur=$(cat "cur_tag")
else
cur=""
fi
# 根据版本差异决定是否更新
if [ "$tag" != "$cur" ]; then
echo $tag > cur_tag
download_url="https://github.com/$repo/releases/download/$tag/go-proxy-bingai-linux-amd64.tar.gz"
wget "$download_url"
tar -xzvf go-proxy-bingai-linux-amd64.tar.gz -O > go-proxy-bingai
rm go-proxy-bingai-linux-amd64.tar.gz
chmod +x go-proxy-bingai
fi
# 拉起服务
./go-proxy-bingai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment