Created
March 25, 2020 11:48
-
-
Save bspavel/ce2e728decd9dc7fc4475bdf2472e174 to your computer and use it in GitHub Desktop.
the installer of the aria2 on the raspberry pi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#https://medium.com/@yuanyifang/download-server-on-raspberry-pi-c5b1050242d8 | |
if [ "$(whoami)" != "root" ]; then | |
echo "Run script as ROOT please. (sudo !!!)" | |
exit | |
fi | |
sudo apt-get install -y aria2 | |
mkdir /home/pi/.aria2/ | |
touch /home/pi/.aria2/aria2.session | |
cat > /home/pi/aria2.conf << "EOF" | |
#directory to save download file | |
dir=/media/aria2 | |
save-session=/home/pi/.aria2/aria2.session | |
input-file=/home/pi/.aria2/aria2.session | |
file-allocation=none | |
enable-dht=true | |
##logging | |
log=/home/pi/.aria2/aria2.log | |
console-log-level=warn | |
log-level=error | |
#Allow to run in the background | |
daemon=true | |
#Replace PPPPP with your password | |
rpc-secret=ariarpc | |
enable-rpc=true | |
#Allow all source to connect | |
rpc-allow-origin-all=true | |
#Default port is 6800 | |
rpc-listen-port=6800 | |
rpc-listen-all=true | |
max-concurrent-downloads=5 | |
continue=true | |
max-connection-per-server=5 | |
min-split-size=10M | |
split=10 | |
max-overall-download-limit=0 | |
max-download-limit=0 | |
max-overall-upload-limit=0 | |
max-upload-limit=0 | |
file-allocation=prealloc | |
check-certificate=false | |
save-session-interval=60 | |
disable-ipv6=true | |
disk-cache=25M | |
timeout=600 | |
retry-wait=30 | |
max-tries=50 | |
EOF | |
#/etc/rc.local | |
su pi -c "aria2c --conf-path=/home/pi/aria2.conf -D" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment