@@ -4,7 +4,7 @@ export PATH
4
4
# --------------------------------------------------------------
5
5
# 系统: ALL
6
6
# 项目: qBittorrent Enhanced Edition 便携版制作 脚本
7
- # 版本: 1.0.6
7
+ # 版本: 1.0.7
8
8
# 作者: XIU2
9
9
# 官网: https://shell.xiu2.xyz
10
10
# 项目: https://github.com/XIU2/Shell
@@ -34,52 +34,26 @@ _CHECK_VER(){
34
34
[[ ! -e ${FOLDER} ]] && mkdir " ${FOLDER} " # 如果主文件夹不存在,就新建
35
35
[[ ! -e ${FILE_OLD_VER} ]] && echo -n ${NEW_VER} > ${FILE_OLD_VER} # 如果旧版本文件不存在,说明是首次运行,则把当前版本号写入该文件
36
36
[[ $( cat ${FILE_OLD_VER} ) == ${NEW_VER} ]] && echo -e " ${INFO} 已经是最新版本!${NEW_VER} [$( date ' +%Y/%m/%d %H:%M' ) ]" && exit 1
37
+ echo -e " ${INFO} 检测到新版本 ${NEW_VER} 开始下载..."
37
38
}
38
39
39
40
# 下载
40
41
_DOWNLOAD (){
41
42
[[ ! -e ${FOLDER_DOWNLOAD} ]] && mkdir " ${FOLDER_DOWNLOAD} " # 如果下载文件夹不存在,就新建
42
43
cd ${FOLDER_DOWNLOAD}
43
- if ! wget --no-check-certificate -q -t2 -T5 -4 -U " ${UA} " -O " qbittorrentEE_x32.exe" " https://github.com/c0re100/qBittorrent-Enhanced-Edition/releases/download/release-${NEW_VER} /qbittorrent_enhanced_${NEW_VER} _setup.exe" ; then
44
- rm -f qbittorrentEE_x32.exe
45
- _NOTICE_MAIL " ERROR" " qBittorrentEE_x32_v${NEW_VER} 下载失败!"
46
- fi
47
44
if ! wget --no-check-certificate -q -t2 -T5 -4 -U " ${UA} " -O " qbittorrentEE_x64.exe" " https://github.com/c0re100/qBittorrent-Enhanced-Edition/releases/download/release-${NEW_VER} /qbittorrent_enhanced_${NEW_VER} _x64_setup.exe" ; then
48
45
rm -f qbittorrentEE_x64.exe
49
46
_NOTICE_MAIL " ERROR" " qBittorrentEE_x64_v${NEW_VER} 下载失败!"
50
47
fi
51
48
}
52
49
53
- _DOWNLOAD_qt6 (){
54
- [[ ! -e ${FOLDER_DOWNLOAD} ]] && mkdir " ${FOLDER_DOWNLOAD} " # 如果下载文件夹不存在,就新建
55
- cd ${FOLDER_DOWNLOAD}
56
- if ! wget --no-check-certificate -q -t2 -T5 -4 -U " ${UA} " -O " qbittorrentEE_qt6_x64.exe" " https://github.com/c0re100/qBittorrent-Enhanced-Edition/releases/download/release-${NEW_VER} /qbittorrent_enhanced_${NEW_VER} _qt6_x64_setup.exe" ; then
57
- rm -f qbittorrentEE_qt6_x64.exe
58
- _NOTICE_MAIL " ERROR" " qBittorrentEE_qt6_x64_v${NEW_VER} 下载失败!"
59
- fi
60
- }
61
-
62
50
# 解压
63
51
_UNZIP (){
64
52
[[ -e ${FOLDER_DOWNLOAD_UNZIP} ]] && rm -rf " ${FOLDER_DOWNLOAD_UNZIP} " # 如果解压文件夹存在,就删除并重建
65
53
mkdir " ${FOLDER_DOWNLOAD_UNZIP} "
66
54
7z x -bb0 -x' !qbittorrent.pdb' -x' !$PLUGINSDIR' -o" ${FOLDER_DOWNLOAD_UNZIP} " qbittorrentEE_x64.exe > /dev/null # 解压64位文件
67
55
[[ ! -e " ${FOLDER_DOWNLOAD_UNZIP} /qbittorrent.exe" ]] && _NOTICE_MAIL " ERROR" " qBittorrentEE_x64_v${NEW_VER} 解压失败!"
68
- mv " ${FOLDER_DOWNLOAD_UNZIP} /qbittorrent.exe" " ${FOLDER_DOWNLOAD_UNZIP} /qbittorrent_x64.exe" # 将 qbittorrent.exe 重命名位 qbittorrent_x64.exe
69
- 7z e -bb0 -o" ${FOLDER_DOWNLOAD_UNZIP} " qbittorrentEE_x32.exe qbittorrent.exe > /dev/null # 解压32位文件,仅 qbittorrent.exe
70
- [[ ! -e " ${FOLDER_DOWNLOAD_UNZIP} /qbittorrent.exe" ]] && _NOTICE_MAIL " ERROR" " qBittorrentEE_x32_v${NEW_VER} 解压失败!"
71
56
rm -rf qbittorrentEE_x64.exe
72
- rm -rf qbittorrentEE_x32.exe
73
- cd " ${FOLDER_DOWNLOAD_UNZIP} /translations"
74
- rm -f $( ls| egrep -v ' zh_' ) # 删除非中文语言文件,如果需要全语言,则注释这一行及上一行(行首加井号)
75
- }
76
-
77
- _UNZIP_qt6 (){
78
- [[ -e ${FOLDER_DOWNLOAD_UNZIP} ]] && rm -rf " ${FOLDER_DOWNLOAD_UNZIP} " # 如果解压文件夹存在,就删除并重建
79
- mkdir " ${FOLDER_DOWNLOAD_UNZIP} "
80
- 7z x -bb0 -x' !qbittorrent.pdb' -x' !$PLUGINSDIR' -o" ${FOLDER_DOWNLOAD_UNZIP} " qbittorrentEE_qt6_x64.exe > /dev/null # 解压64位文件
81
- [[ ! -e " ${FOLDER_DOWNLOAD_UNZIP} /qbittorrent.exe" ]] && _NOTICE_MAIL " ERROR" " qBittorrentEE_qt6_x64_v${NEW_VER} 解压失败!"
82
- rm -rf qbittorrentEE_qt6_x64.exe
83
57
cd " ${FOLDER_DOWNLOAD_UNZIP} /translations"
84
58
rm -f $( ls| egrep -v ' zh_' ) # 删除非中文语言文件,如果需要全语言,则注释这一行及上一行(行首加井号)
85
59
}
@@ -89,30 +63,19 @@ _ZIP(){
89
63
cd ${FOLDER_DOWNLOAD}
90
64
# 复制配置等文件到文件夹内
91
65
cp -r " ${FOLDER_OTHER} " /* " ${FOLDER_DOWNLOAD_UNZIP} "
92
- 7z a -bb0 " qBittorrentEE_v${NEW_VER} _便携版.${FILE_FORMAT} " " qBittorrentEE" " " > /dev/null # 压缩
93
- rm -rf " ${FOLDER_DOWNLOAD_UNZIP} " # 删除前面解压,已经无用文件夹
94
- [[ ! -e " qBittorrentEE_v${NEW_VER} _便携版.${FILE_FORMAT} " ]] && _NOTICE_MAIL " ERROR" " qBittorrentEE_v${NEW_VER} 压缩失败!"
95
- [[ ! -e ${FOLDER_UPLOAD} ]] && mkdir " ${FOLDER_UPLOAD} " # 如果上传文件夹不存在,就新建
96
- mv " qBittorrentEE_v${NEW_VER} _便携版.${FILE_FORMAT} " " ${FOLDER_UPLOAD} " # 移动到上传文件夹
97
-
98
- }
99
-
100
- _ZIP_qt6 (){
101
- cd ${FOLDER_DOWNLOAD}
102
- # 复制配置等文件到文件夹内
103
- cp -r " ${FOLDER_OTHER} " /* " ${FOLDER_DOWNLOAD_UNZIP} "
104
- 7z a -bb0 " qBittorrentEE_v${NEW_VER} _qt6_x64_便携版.${FILE_FORMAT} " " qBittorrentEE" " " > /dev/null # 压缩
66
+ 7z a -bb0 " qBittorrentEE_v${NEW_VER} _x64_便携版.${FILE_FORMAT} " " qBittorrentEE" " " > /dev/null # 压缩
105
67
rm -rf " ${FOLDER_DOWNLOAD_UNZIP} " # 删除前面解压,已经无用文件夹
106
- [[ ! -e " qBittorrentEE_v${NEW_VER} _qt6_x64_便携版 .${FILE_FORMAT} " ]] && _NOTICE_MAIL " ERROR" " qBittorrentEE_v${NEW_VER} _qt6_x64 压缩失败!"
68
+ [[ ! -e " qBittorrentEE_v${NEW_VER} _x64_便携版 .${FILE_FORMAT} " ]] && _NOTICE_MAIL " ERROR" " qBittorrentEE_v${NEW_VER} 压缩失败!"
107
69
[[ ! -e ${FOLDER_UPLOAD} ]] && mkdir " ${FOLDER_UPLOAD} " # 如果上传文件夹不存在,就新建
108
- mv " qBittorrentEE_v${NEW_VER} _qt6_x64_便携版 .${FILE_FORMAT} " " ${FOLDER_UPLOAD} " # 移动到上传文件夹
70
+ mv " qBittorrentEE_v${NEW_VER} _x64_便携版 .${FILE_FORMAT} " " ${FOLDER_UPLOAD} " # 移动到上传文件夹
109
71
110
72
}
111
73
112
74
# 上传
113
75
_UPLOAD (){
114
- bash ${LZY_PATH} " qBittorrentEE_v${NEW_VER} _便携版.${FILE_FORMAT} " " ${FOLDER_UPLOAD} /qBittorrentEE_v${NEW_VER} _便携版.${FILE_FORMAT} " " ${FOLDER_ID} "
115
- # _NOTICE "INFO" "qBittorrentEE_v${NEW_VER}" # 你可以取消井号注释,这样每次更新也会推送消息至微信
76
+ bash ${LZY_PATH} " ${FOLDER_UPLOAD} /qBittorrentEE_v${NEW_VER} _x64_便携版.${FILE_FORMAT} " " ${FOLDER_ID} "
77
+ [[ ${?} -ne 0 ]] && echo -e " ${ERROR} 上传到蓝奏云失败,终止后续!" && exit 1
78
+ # _NOTICE_MAIL "INFO" "qBittorrentEE_v${NEW_VER}" # 你可以取消井号注释,这样每次更新也会推送消息至微信
116
79
}
117
80
118
81
# 通知
@@ -137,9 +100,6 @@ _CHECK_VER "$1" # 运行脚本的时候传递参数可以指定版本号,例
137
100
_DOWNLOAD
138
101
_UNZIP
139
102
_ZIP
140
- _DOWNLOAD_qt6
141
- _UNZIP_qt6
142
- _ZIP_qt6
143
103
144
104
echo -n ${NEW_VER} > ${FILE_OLD_VER}
145
105
# _UPLOAD # 如果不想上传到蓝奏云,可以把这行注释掉(行首加井号)
0 commit comments