Skip to content

Instantly share code, notes, and snippets.

@chrisyip
Created June 11, 2017 15:12
Show Gist options
  • Save chrisyip/9ee1e68ad404d1e56fef194eedf40490 to your computer and use it in GitHub Desktop.
Save chrisyip/9ee1e68ad404d1e56fef194eedf40490 to your computer and use it in GitHub Desktop.
aria2 on R7500v2
# Aria2 configuration
# RPC Setting
enable-rpc=true
rpc-listen-all=true
rpc-allow-origin-all=true
rpc-listen-port=6800
rpc-secret=aria2_secret
# General Setting
dir=/opt/file_server/
input-file=/opt/aria2/aria2.session
save-session=/opt/aria2/aria2.session
save-session-interval=60
dht-file-path=/opt/aria2/dht.dat
log=/opt/aria2/aria2.log
log-level=warn
disk-cache=8M
file-allocation=prealloc
# Connection Setting
continue=true
max-concurrent-downloads=3
min-split-size=10M
split=5
max-overall-upload-limit=200K
lowest-speed-limit=1K
auto-save-interval=120
check-certificate=false
# BT/PT Setting
bt-require-crypto=true
follow-torrent=true
bt-save-metadata=true
bt-seed-unverified=true
seed-ratio=1
seed-time=5
disable-ipv6=true
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin:$PATH
restart(){
echo "starting aria2 ..."
killall aria2c
sleep 1
iptables -D INPUT -p tcp --dport 48028 -j ACCEPT
iptables -I INPUT -p tcp --dport 48028 -j ACCEPT
iptables -D INPUT -p udp --dport 48028 -j ACCEPT
iptables -I INPUT -p udp --dport 48028 -j ACCEPT
iptables -D INPUT -p tcp --dport 6800 -j ACCEPT
iptables -I INPUT -p tcp --dport 6800 -j ACCEPT
aria2c --conf-path=/opt/aria2/aria2.conf -c -D
echo "aria2 started"
}
if [ ! -d "/opt/aria2/" ]; then
echo "/opt/aria2/ not found"
exit 1
fi
for var in "$@"
do
if [ "$var" == "--restart" ]; then
restart
exit
fi
done
if [ -n "$(ps | grep "\s\{2,\}aria2c")" ]; then
echo "aria2 already running"
else
restart
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment