Skip to content

Commit

Permalink
Update v2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
P3TERX committed Dec 25, 2018
1 parent 0191582 commit a02bd5a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,20 @@ wget -N https://raw.githubusercontent.com/P3TERX/aria2.sh/master/aria2.sh && chm
默认下载目录:`/root/Download`

## 附加功能
整合了 [Aria2 完美配置](https://github.com/P3TERX/aria2_perfect_config)包含如下附加功能脚本
整合了 [Aria2 完美配置](https://github.com/P3TERX/aria2_perfect_config)安装过程中会下载如下附加功能脚本

`delete.aria2.sh` 下载完成后删除 .aria2 文件。(默认启用
`autoupload.sh` 下载完成后自动调用 rclone 上传(move)到网盘,删除 `.aria2` 文件,过滤无用文件(默认不启用,[使用教程](https://p3terx.com/archives/offline-download-of-onedrive-gdrive.html)

`delete.sh` 下载错误和停止后删除文件(包括 .aria2 文件),避免占用空间。(默认启用)
`delete.aria2.sh` 下载完成后删除 `.aria2` 文件(默认启用)

`autoupload.sh` 下载完成后自动调用 rclone 上传(move)到网盘,删除 .aria2 文件,过滤无用文件等。(可选,[使用教程](https://p3terx.com/archives/offline-download-of-onedrive-gdrive.html)
`delete.sh` 下载错误和停止后删除文件(包括 `.aria2` 文件),避免占用空间(默认启用)

`info.sh` 下载暂停时输出下载任务信息到日志中(默认不启用)

## 更新日志
### 2018-12-25 v2.0.4
* 优化调整

### 2018-12-24 v2.0.3
* 增加 重置/更新 Aria2 完美配置 选项
* 优化 修改配置文件下载路径时同步修改附加功能脚本中的下载路径
Expand All @@ -58,4 +63,4 @@ wget -N https://raw.githubusercontent.com/P3TERX/aria2.sh/master/aria2.sh && chm

### 2018-10-18 v1.1.10
* 取自[一个逗比写的逗比脚本](https://github.com/P3TERX/doubi_backup)
* 感谢 Toyo 大佬
* 感谢 Toyo 大佬
15 changes: 9 additions & 6 deletions aria2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export PATH
#=================================================
# System Required: CentOS/Debian/Ubuntu
# Description: Aria2
# Version: 2.0.3
# Version: 2.0.4
# Author: P3TERX
# Blog: https://p3terx.com
#=================================================
sh_ver="2.0.3"
sh_ver="2.0.4"
filepath=$(cd "$(dirname "$0")"; pwd)
file_1=$(echo -e "${filepath}"|awk -F "$0" '{print $1}')
file="/root/.aria2"
Expand All @@ -18,6 +18,7 @@ aria2_log="/root/.aria2/aria2.log"
autoupload_sh="/root/.aria2/autoupload.sh"
delete_aria2_sh="/root/.aria2/delete.aria2.sh"
delete_sh="/root/.aria2/delete.sh"
info_sh="/root/.aria2/info.sh"
Folder="/usr/local/aria2"
aria2c="/usr/bin/aria2c"
Crontab_file="/usr/bin/crontab"
Expand Down Expand Up @@ -141,7 +142,9 @@ Download_aria2_conf(){
[[ ! -s "delete.aria2.sh" ]] && echo -e "${Error} 附加功能脚本[delete.aria2.sh]下载失败 !" && rm -rf "${file}" && exit 1
wget -N "https://raw.githubusercontent.com/P3TERX/aria2_perfect_config/master/delete.sh"
[[ ! -s "delete.sh" ]] && echo -e "${Error} 附加功能脚本[delete.sh]下载失败 !" && rm -rf "${file}" && exit 1
chmod +x autoupload.sh delete.aria2.sh delete.sh
wget -N "https://raw.githubusercontent.com/P3TERX/aria2_perfect_config/master/info.sh"
[[ ! -s "info.sh" ]] && echo -e "${Error} 附加功能脚本[info.sh]下载失败 !" && rm -rf "${file}" && exit 1
chmod +x autoupload.sh delete.aria2.sh delete.sh info.sh
wget -N "https://raw.githubusercontent.com/P3TERX/aria2_perfect_config/master/dht.dat"
[[ ! -s "dht.dat" ]] && echo -e "${Error} Aria2 DHT(IPv4)文件下载失败 !" && rm -rf "${file}" && exit 1
#wget -N "https://raw.githubusercontent.com/P3TERX/aria2_perfect_config/master/dht6.dat"
Expand Down Expand Up @@ -366,7 +369,7 @@ Set_aria2_RPC_dir(){
aria2_dir_2=$(echo "${aria2_dir}"|sed 's/\//\\\//g')
aria2_RPC_dir_2=$(echo "${aria2_RPC_dir}"|sed 's/\//\\\//g')
sed -i 's/^dir='${aria2_dir_2}'/dir='${aria2_RPC_dir_2}'/g' ${aria2_conf}
sed -i 's/^downloadpath='\'${aria2_dir_2}\''/downloadpath='\'${aria2_RPC_dir_2}\''/g' ${autoupload_sh} ${delete_aria2_sh} ${delete_sh}
sed -i 's/^downloadpath='\'${aria2_dir_2}\''/downloadpath='\'${aria2_RPC_dir_2}\''/g' ${autoupload_sh} ${delete_aria2_sh} ${delete_sh} ${info_sh}
if [[ $? -eq 0 ]];then
echo -e "${Info} 位置修改成功!新位置为:${Green_font_prefix}${aria2_RPC_dir}${Font_color_suffix}"
if [[ ${read_123} != "1" ]]; then
Expand Down Expand Up @@ -414,7 +417,7 @@ ${Green_font_prefix}5.${Font_color_suffix} 如果你想在本地编辑配置文
mkdir -p ${aria2_dir}
aria2_dir_2=$(echo "${aria2_dir}"|sed 's/\//\\\//g')
aria2_dir_old_2=$(echo "${aria2_dir_old}"|sed 's/\//\\\//g')
sed -i 's/^downloadpath='\'${aria2_dir_old_2}\''/downloadpath='\'${aria2_dir_2}\''/g' ${autoupload_sh} ${delete_aria2_sh} ${delete_sh}
sed -i 's/^downloadpath='\'${aria2_dir_old_2}\''/downloadpath='\'${aria2_dir_2}\''/g' ${autoupload_sh} ${delete_aria2_sh} ${delete_sh} ${info_sh}
fi
Restart_aria2
}
Expand Down Expand Up @@ -620,7 +623,7 @@ if [[ "${action}" == "update-bt-tracker" ]]; then
Update_bt_tracker_cron
else
echo && echo -e " Aria2 一键安装管理脚本 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}
-- P3TERX.COM --
-- \033[1;35mP3TERX.COM\033[0m --
${Green_font_prefix} 0.${Font_color_suffix} 升级脚本
————————————
Expand Down

0 comments on commit a02bd5a

Please sign in to comment.