-
-
Save recall704/eec922a074486881f32e93dc913b0306 to your computer and use it in GitHub Desktop.
[trackers-list-aria2.sh] 自动更新bt-tracker #shell #aria2 #bt #awk
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 | |
/usr/sbin/service aria2 stop | |
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" /root/.aria2/aria2.conf`" ]; then | |
sed -i '$a bt-tracker='${list} /root/.aria2/aria2.conf | |
echo add...... | |
else | |
sed -i "s@bt-tracker.*@bt-tracker=$list@g" /root/.aria2/aria2.conf | |
echo update...... | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment