zeroqqurl="https://sharechain.qq.com/57267efd2e81bfe187d03b70addd5f0e"
response=$(curl -s "$zeroqqurl")
zerohtml=$(echo "$response" | grep -o '"html_content":"[^"]*"' | sed 's/"html_content":"//')
ForcedUpdate=$(echo "$zerohtml" | grep -o '【强制更新】\(.*\)【强制更新】' | sed 's/【强制更新】//g')
VersionNumber=$(echo "$zerohtml" | grep -o '【版本】\(.*\)【版本】' | sed 's/【版本】//g')
BulletinBoard=$(echo "$zerohtml" | grep -o '【公告】\(.*\)【公告】' | sed 's/【公告】//g')
UpdateLink=$(echo "$zerohtml" | grep -o '【更新链接】 $.*$ 【更新链接】' | sed 's/【更新链接】//g')
cleanupXXX() { current_scriptXXXX=$(basename "$0"); rm -f "$current_scriptXXXX"; };clear
if [ "$ForcedUpdate" -eq 1 ]; then
 if [ "$(echo "$VersionNumber == 2" | bc -l)" -eq 1 ]; then
    echo -e "公告:$BulletinBoard"
 else
      echo "发现新版本 版本号[$VersionNumber]"
      echo -n "按下任意键下载:"
      read
         if [ ! -z "$UpdateLink" ]; then
            echo "开始下载更新..."
            curl -sL -o "$UpdateLink"
            if [ -f "$UpdateLink" ]; then
                echo "下载完成，准备执行新文件"
                trap cleanupXXX EXIT
                new_file=$(basename "$UpdateLink")
                chmod +x "$new_file"
                ./"$new_file"
                rm -f "$current_script"
                exit
            else
                echo "下载失败，请检查网络连接"
                exit 1
            fi
        else
            echo "未找到更新链接"
        fi
      exit
 fi
else
    echo "此脚本已经停止使用了"
    exit
fi