From ba7d8e9e8a1f748a56f5a89e9461c40a0f801151 Mon Sep 17 00:00:00 2001 From: Toyo Date: Sat, 6 Oct 2018 11:02:57 +0800 Subject: [PATCH] =?UTF-8?q?#=20v1.2.4=20=E6=94=AF=E6=8C=81=20ARM=20?= =?UTF-8?q?=E6=9E=84=E6=9E=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloudt.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cloudt.sh b/cloudt.sh index e0f60be..9917d1a 100644 --- a/cloudt.sh +++ b/cloudt.sh @@ -5,12 +5,12 @@ export PATH #================================================= # System Required: CentOS/Debian/Ubuntu # Description: Cloud Torrent -# Version: 1.2.3 +# Version: 1.2.4 # Author: Toyo # Blog: https://doub.io/wlzy-12/ #================================================= -sh_ver="1.2.3" +sh_ver="1.2.4" file="/usr/local/cloudtorrent" ct_file="/usr/local/cloudtorrent/cloud-torrent" dl_file="/usr/local/cloudtorrent/downloads" @@ -53,7 +53,7 @@ check_pid(){ PID=$(ps -ef | grep cloud-torrent | grep -v grep | awk '{print $2}') } check_new_ver(){ - ct_new_ver=$(wget --no-check-certificate -qO- https://github.com/jpillora/cloud-torrent/releases/latest | grep "" | sed -r 's/.*Release (.+) · jpillora.*/\1/') + ct_new_ver=$(wget --no-check-certificate -qO- -t2 -T3 https://api.github.com/repos/jpillora/cloud-torrent/releases| grep "tag_name"| head -n 1| awk -F ":" '{print $2}'| sed 's/\"//g;s/,//g;s/ //g;s/v//g') if [[ -z ${ct_new_ver} ]]; then echo -e "${Error} Cloud Torrent 最新版本获取失败,请手动获取最新版本号[ https://github.com/jpillora/cloud-torrent/releases ]" stty erase '^H' && read -p "请输入版本号 [ 格式 x.x.xx , 如 0.8.21 ] :" ct_new_ver @@ -83,8 +83,10 @@ Download_ct(){ cd ${file} if [[ ${bit} == "x86_64" ]]; then wget --no-check-certificate -O cloud-torrent.gz "https://github.com/jpillora/cloud-torrent/releases/download/${ct_new_ver}/cloud-torrent_linux_amd64.gz" - else + elif [[ ${bit} == "i386" || ${bit} == "i686" ]]; then wget --no-check-certificate -O cloud-torrent.gz "https://github.com/jpillora/cloud-torrent/releases/download/${ct_new_ver}/cloud-torrent_linux_386.gz" + else + wget --no-check-certificate -O cloud-torrent.gz "https://github.com/jpillora/cloud-torrent/releases/download/${ct_new_ver}/cloud-torrent_linux_arm.gz" fi [[ ! -e "cloud-torrent.gz" ]] && echo -e "${Error} Cloud Torrent 下载失败 !" && exit 1 gzip -d cloud-torrent.gz