Created
June 28, 2023 09:02
-
-
Save yocoldle/6019b3091670f484e186397a58ccb264 to your computer and use it in GitHub Desktop.
replit部署go-proxy-bingai, 理论其他平台可用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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