Forked from leozhang2018/gist:3d348528f8f9c54be9d901f444b622a0
Last active
January 8, 2022 03:07
-
-
Save malagebidi/b6a2c76d6081c8080080e5fb0f3f3bda to your computer and use it in GitHub Desktop.
Auto update aria2 tracker from github
This file contains hidden or 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 | |
#ref: https://github.com/ngosang/trackerslist | |
killall aria2c &>/dev/null | |
list=`wget -qO- https://ngosang.github.io/trackerslist/trackers_all_ip.txt|awk NF|sed ":a;N;s/\n/,/g;ta"` | |
if [ -z "`grep "bt-tracker" /etc/aria2/aria2.conf`" ]; then | |
sed -i '$a bt-tracker='${list} /etc/aria2/aria2.conf | |
echo add......starting | |
sleep 3 | |
sudo aria2c --conf-path=/etc/aria2/aria2.conf -D | |
ps -aux|grep aria | |
else | |
sed -i "s@bt-tracker.*@bt-tracker=$list@g" /etc/aria2/aria2.conf | |
echo update......starting | |
sleep 3 | |
sudo aria2c --conf-path=/etc/aria2/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