Created
May 14, 2018 11:03
-
-
Save leozhang2018/3d348528f8f9c54be9d901f444b622a0 to your computer and use it in GitHub Desktop.
Auto update aria2 tracker from github
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 | |
killall aria2c &>/dev/null | |
list=`wget -qO- https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt|awk NF|sed ":a;N;s/\n/,/g;ta"` | |
if [ -z "`grep "bt-tracker" /aria/aria2.conf`" ]; then | |
sed -i '$a bt-tracker='${list} /aria/aria2.conf | |
echo add......starting | |
sleep 3 | |
sudo -u www-data aria2c --conf-path=/aria/aria2.conf -D | |
ps -aux|grep aria | |
else | |
sed -i "s@bt-tracker.*@bt-tracker=$list@g" /aria/aria2.conf | |
echo update......starting | |
sleep 3 | |
sudo -u www-data aria2c --conf-path=/aria/aria2.conf -D | |
ps -aux|grep aria | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ref: