Skip to content

Commit

Permalink
update quick-install.sh and aria2 config file
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxuan8282 committed Nov 19, 2016
1 parent 6c67949 commit 1d84684
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 134 deletions.
77 changes: 6 additions & 71 deletions aria2.conf
Original file line number Diff line number Diff line change
@@ -1,83 +1,18 @@
# 基本配置
# 下载目录
dir=/home/pi/Download
# 下载从这个文件中找到的urls, 需自己建立这个文件
# touch /home/pi/.aria2/aria2.session
input-file=/home/pi/.aria2/aria2.session
# 最大同时下载任务数,默认 5
#max-concurrent-downloads=5
# 断点续传,只适用于 HTTP(S)/FTP
continue=true

# HTTP/FTP 配置
# 关闭连接如果下载速度等于或低于这个值,默认 0
#lowest-speed-limit=0
# 对于每个下载在同一个服务器上的连接数,默认 1
dir=$HOME
input-file=$HOME/.config/aria2/session.lock
#max-concurrent-downloads=3
max-connection-per-server=5
# 每个文件最小分片大小,例如文件 20M,设置 size 为 10M, 则用2个连接下载,默认 20M
#min-split-size=10M
# 下载一个文件的连接数,默认 5
#split=5

# BT 特殊配置
# 启用本地节点查找,默认 false
bt-enable-lpd=true
# 指定最大文件数对于每个 bt 下载,默认 100
#bt-max-open-files=100
# 单种子最大连接数,默认 55
#bt-max-peers=55
# 设置最低的加密级别,可选全连接加密 arc4,默认是头加密 plain
#bt-min-crypto-level=plain
# 总是使用 obfuscation handshake,防迅雷必备,默认 false
bt-require-crypto=true
# 如果下载的是种子文件则自动解析并下载,默认 true
#follow-torrent=true
# 为 BT 下载设置 TCP 端口号,确保开放这些端口,默认 6881-6999
listen-port=65298
#Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker
dht-listen-port=65298
# 整体上传速度限制,0 表示不限制,默认 0
#max-overall-upload-limit=0
# 每个下载上传速度限制,默认 0
#max-upload-limit=0
# 种子分享率大于1, 则停止做种,默认 1.0
#seed-ratio=1
# 做种时间大于2小时,则停止做种
seed-time=120

# RPC 配置
# 开启 JSON-RPC/XML-RPC 服务,默认 false
enable-rpc=true
# 允许所有来源,web 界面跨域权限需要,默认 false
rpc-allow-origin-all=true
# 允许外部访问,默认 false
rpc-listen-all=true
# rpc 端口,默认 6800
rpc-listen-port=6800
# 设置最大的 JSON-RPC/XML-RPC 请求大小,默认 2M
#rpc-max-request-size=2M
# rpc 密码,可不设置
#rpc-passwd=raspberry
# rpc 用户名,可不设置
#rpc-user=aria2pi

# 高级配置
# This is useful if you have to use broken DNS and
# want to avoid terribly slow AAAA record lookup.
# 默认 false
#disable-ipv6=true
# 指定文件分配方法,预分配能有效降低文件碎片,提高磁盘性能,缺点是预分配时间稍长
# 如果使用新的文件系统,例如 ext4 (with extents support), btrfs, xfs or NTFS(MinGW build only), falloc 是最好的选择
# 如果设置为 none,那么不预先分配文件空间,默认 prealloc
disable-ipv6=true
file-allocation=none
# 整体下载速度限制,默认 0
#max-overall-download-limit=0
# 每个下载下载速度限制,默认 0
#max-download-limit=0
# 保存错误或者未完成的下载到这个文件
# 和基本配置中的 input-file 一起使用,那么重启后仍可继续下载
save-session=/home/pi/.aria2/aria2.session
# 每5分钟自动保存错误或未完成的下载,如果为 0, 只有 aria2 正常退出才回保存,默认 0
save-session-interval=300

# 若要用于 PT 下载,需另外的配置,这里没写
save-session=$HOME/.config/aria2/session.lock
save-session-interval=300
9 changes: 9 additions & 0 deletions aria2.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Aria2 Service
After=network.target

[Service]
ExecStart=/usr/bin/aria2c --enable-rpc --rpc-listen-all --rpc-allow-origin-all --save-session %h/.config/aria2/session.lock --input-file %h/.config/aria2/session.lock --conf-path=%h/.config/aria2/aria2.conf

[Install]
WantedBy=default.target
57 changes: 0 additions & 57 deletions aria2c

This file was deleted.

14 changes: 8 additions & 6 deletions quick-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ if ! [[ -f /usr/bin/wechat-remote ]]; then
git clone https://github.com/yangxuan8282/wechat-remote /tmp/wechat-remote
git clone https://github.com/baskerville/diana /tmp/diana
sudo pip install itchat
sudo pip install subprocess32
sudo cp /tmp/diana/diana /usr/bin
sudo cp /tmp/diana/dad /usr/bin
sudo chmod 755 /usr/bin/dad /usr/bin/diana
mkdir -p ~/.aria2/aria2
touch ~/.aria2/aria2.session
sudo cp /tmp/wechat-remote/aria2.conf ~/.config/.aira2/
sudo cp /tmp/wechat-remote/aria2c /etc/init.d/aria2c
sudo chmod +x /etc/init.d/aria2c
sudo service aria2c restart
mkdir -p $HOME/.config/aria2
cp aria2.conf $HOME/.config/aria2/aria2.conf
touch $HOME/.config/aria2/session.lock
sudo cp aria2.service /etc/systemd/user
systemctl --user start aria2
systemctl --user enable aria2
dad start
sudo cp /tmp/wechat-remote/wechat_remote.py /usr/bin/wechat-remote
sudo chmod 755 /usr/bin/wechat-remote
fi

0 comments on commit 1d84684

Please sign in to comment.