Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto get final version #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
CHINAIP=$(curl -s https://api.ip.sb/geoip | grep China)
if [ ! -n "$CHINAIP" ]; then
UDP2RAW_URL=https://github.com/wangyu-/udp2raw/releases/download/20200818.0/udp2raw_binaries.tar.gz
UDPSPEEDER_URL=https://github.com/wangyu-/UDPspeeder/releases/download/20210116.0/speederv2_binaries.tar.gz
else
ver=$(wget --no-check-certificate -qO- https://api.github.com/repos/wangyu-/UDP2raw/releases/latest | grep 'tag_name' | cut -d\" -f4)
[ -z ${ver} ] && echo "Error: Get UDP2raw latest version failed" && exit 1

UDP2RAW_URL=https://github.com/wangyu-/udp2raw/releases/download/${ver}/udp2raw_binaries.tar.gz

ver=$(wget --no-check-certificate -qO- https://api.github.com/repos/wangyu-/UDPspeeder/releases/latest | grep 'tag_name' | cut -d\" -f4)
[ -z ${ver} ] && echo "Error: Get UDPspeeder latest version failed" && exit 1

UDPSPEEDER_URL="https://github.com/wangyu-/UDPspeeder/releases/download/${ver}/speederv2_binaries.tar.gz"
else
UDP2RAW_URL=https://soft.huayizhiyun.com/network/udptools/udp2raw/udp2raw_20200818.tar.gz
UDPSPEEDER_URL=https://soft.huayizhiyun.com/network/udptools/udpspeeder/speederv2_20210116.tar.gz
fi
Expand Down Expand Up @@ -107,4 +114,4 @@ fi

echo "更新完成,请使用udptools脚本添加服务"
echo "Udp2Raw BIN: /usr/local/udptools/bin/udp2raw"
echo "UdpSpeeder BIN:/usr/local/udptools/bin/udpspeeder"
echo "UdpSpeeder BIN:/usr/local/udptools/bin/udpspeeder"