Skip to content

Commit

Permalink
update delete.sh & delete.aria2.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperNG6 committed Jan 16, 2020
1 parent a5be0fa commit 22d419a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 31 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ __当前的镜像或多或少都有以下几点不符合的我的需求__


# Changelogs
## 2020/01/15

1、update delete.sh & delete.aria2.sh
## 2020/01/10

1、增加arm64v8、arm32v7平台镜像
Expand Down
28 changes: 14 additions & 14 deletions root/aria2/script/delete.aria2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ rdp=${filepath#${downloadpath}/}
path=${downloadpath}/${rdp%%/*}

if [ $2 -eq 0 ]
then
exit 0
then
exit 0
elif [ "$path" = "$filepath" ] && [ $2 -eq 1 ]
then
rm -vf "$filepath".aria2
exit 0
elif [ "$path" != "$filepath" ] && [ -e "$filepath".aria2 ]
then
rm -vf "$filepath".aria2
exit 0
elif [ "$path" != "$filepath" ] && [ -e "$path".aria2 ]
then
rm -vf "$path".aria2
exit 0
fi
then
[ -e "$filepath".aria2 ] && rm -vf "$filepath".aria2
exit 0
elif [ "$path" != "$filepath" ] && [ $2 -gt 1 ]
then
[ -e "$path".aria2 ] && rm -vf "$path".aria2
exit 0
elif [ "$path" != "$filepath" ] && [ $2 -eq 1 ]
then
[ -e "$filepath".aria2 ] && rm -vf "$filepath".aria2
exit 0
fi
31 changes: 14 additions & 17 deletions root/aria2/script/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ rdp=${filepath#${downloadpath}/}
path=${downloadpath}/${rdp%%/*}

if [ $2 -eq 0 ]
then
exit 0
then
exit 0
elif [ "$path" = "$filepath" ] && [ $2 -eq 1 ]
then
rm -vf "$filepath".aria2
rm -vf "$filepath"
exit 0
elif [ "$path" != "$filepath" ] && [ -e "$filepath".aria2 ]
then
rm -vf "$filepath".aria2
rm -vf "$filepath"
rmdir -v "${filepath%/*}"
exit 0
elif [ "$path" != "$filepath" ] && [ -e "$path".aria2 ]
then
rm -vf "$path".aria2
rm -vrf "$path"
exit 0
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

0 comments on commit 22d419a

Please sign in to comment.