forked from P3TERX/aria2.conf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.sh
56 lines (52 loc) · 1.87 KB
/
info.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#============================================================
# https://github.com/P3TERX/aria2.conf
# File name:info.sh
# Description: Display Aria2 download information when paused
# Lisence: MIT
# Version: 1.3
# Author: P3TERX
# Blog: https://p3terx.com
#============================================================
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
uploadpath=$filepath
aria2file="$filepath".aria2
elif [ "$path" != "$filepath" ] && [ -e "$filepath".aria2 ]
then
uploadpath=$filepath
aria2file="$filepath".aria2
elif [ "$path" != "$filepath" ] && [ -e "$path".aria2 ]
then
uploadpath=$path
aria2file="$path".aria2
fi
echo
echo
echo -e "[\033[1;32m暂停\033[0m] 下载任务信息:"
echo -e "-------------------------- [\033[1;33m信息\033[0m] --------------------------"
echo -e "\033[1;35m文件数:\033[0m$2"
echo -e "\033[1;35m下载路径:\033[0m${downloadpath}"
echo -e "\033[1;35m文件路径:\033[0m${filepath}"
echo -e "\033[1;35m上传路径:\033[0m${uploadpath}"
echo -e "\033[1;35m.aria2 文件路径:\033[0m${aria2file}"
echo -e "-------------------------- [\033[1;33m信息\033[0m] --------------------------"
echo
echo
echo -e "[\033[1;32mPAUSE\033[0m] Download task information:"
echo -e "-------------------------- [\033[1;33mINFO\033[0m] --------------------------"
echo -e "\033[1;35mNumber of files: \033[0m$2"
echo -e "\033[1;35mDownload path:\033[0m${downloadpath}"
echo -e "\033[1;35mFile path: \033[0m${filepath}"
echo -e "\033[1;35mUpload path: \033[0m${uploadpath}"
echo -e "\033[1;35m.aria2 file path: \033[0m${aria2file}"
echo -e "-------------------------- [\033[1;33mINFO\033[0m] --------------------------"
echo
echo