1 Star 0 Fork 1

LY/aria2.conf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
delete.sh 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
P3TERX 提交于 2020-01-15 21:30 . Update 2020-01-15
#!/bin/bash
#=====================================================
# https://github.com/P3TERX/aria2.conf
# File name:delete.sh
# Description: Delete files after Aria2 download error
# Lisence: MIT
# Version: 1.9
# Author: P3TERX
# Blog: https://p3terx.com
#=====================================================
# Aria2下载目录
# TIPS:一键脚本推荐使用选项进行修改,Docker 无需修改。
downloadpath='/root/Download'
#=====================================================
filepath=$3
rdp=${filepath#${downloadpath}/}
path=${downloadpath}/${rdp%%/*}
if [ $2 -eq 0 ]
then
exit 0
elif [ "$path" = "$filepath" ] && [ $2 -eq 1 ]
then
[ -e "$filepath".aria2 ] && rm -vf "$filepath".aria2 "$filepath"
exit 0
elif [ "$path" != "$filepath" ] && [ $2 -gt 1 ]
then
[ -e "$path".aria2 ] && rm -vrf "$path".aria2 "$path"
exit 0
elif [ "$path" != "$filepath" ] && [ $2 -eq 1 ]
then
[ -e "$filepath".aria2 ] && rm -vf "$filepath".aria2 "$filepath"
find "${downloadpath}" ! -path "${downloadpath}" -depth -type d -empty -exec rm -vrf {} \;
exit 0
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/LY703198594/aria2.conf.git
git@gitee.com:LY703198594/aria2.conf.git
LY703198594
aria2.conf
aria2.conf
master

搜索帮助