自动更新Aria2中的bt-trackers选项

#!/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" /etc/aria2/aria2.conf`" ]; then
    sed -i '$a bt-tracker='${list} /etc/aria2/aria2.conf
    echo add......
else
    sed -i "s@bt-tracker.*@bt-tracker=$list@g" /etc/aria2/aria2.conf
    echo update......
fi
posted @ 2019-01-02 21:36  Mrcoool  阅读(3285)  评论(0编辑  收藏  举报