Merge pull request #567 from ThornBirds77/patch-1

Update install-tr-control.sh
This commit is contained in:
Alex Wang 2021-09-24 14:38:00 -07:00 committed by GitHub
commit 4b2e1858f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,7 +248,8 @@ download() {
fi
showLog "$MSG_DOWNLOADING"
echo ""
wget "$DOWNLOAD_URL" --no-check-certificate
# 下载的时候强制命名文件,以免被重定向后文件名发生改变
wget "$DOWNLOAD_URL" -O "$PACK_NAME" --no-check-certificate
# 判断是否下载成功
if [ $? -eq 0 ]; then
showLog "$MSG_DOWNLOAD_COMPLETE"
@ -436,7 +437,9 @@ getTransmissionPath() {
# 获取最后的发布版本号
# 因在源码库里提交二进制文件不便于管理,以后将使用这种方式获取最新发布的版本
getLatestReleases() {
VERSION=`wget -O - https://api.github.com/repos/ronggang/transmission-web-control/releases/latest | grep tag_name | head -n 1 | cut -d '"' -f 4`
# VERSION=`wget -O - https://api.github.com/repos/ronggang/transmission-web-control/releases/latest | grep tag_name | head -n 1 | cut -d '"' -f 4`
# 换为curl避免OpenWRT下wget得到的内容没有分行导致grep输出结果失效
VERSION=`curl -s https://api.github.com/repos/ronggang/transmission-web-control/releases/latest | grep tag_name | head -n 1 | cut -d '"' -f 4`
}
# 检测 Transmission 进程是否存在