首页 > 服务器 > 自动更新aria2的bt-tracker列表

作者:ghostry 发布时间:2018-12-18 浏览: 2274

转载注明出处: https://blog.ghostry.cn/server/892.html

自动更新脚本如下

#!/bin/bash
/etc/init.d/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 [ ! $list ]; then
  echo "list IS NULL"
else
if [ -z "`grep "bt-tracker=" /data/etc/aria2/aria2.conf`" ]; then
    sed -i '$a bt-tracker='${list} /data/etc/aria2/aria2.conf
    echo add......
else
    sed -i "s@bt-tracker=.*@bt-tracker=$list@g" /data/etc/aria2/aria2.conf
    echo update......
fi
fi
blacklist=`wget -qO- https://raw.githubusercontent.com/ngosang/trackerslist/master/blacklist.txt|sed "s:\s*#.*$::g"|awk NF|sed ":a;N;s/\n/,/g;ta"`
if [ ! $blacklist ]; then
  echo "blacklist IS NULL"
else
if [ -z "`grep "bt-exclude-tracker=" /data/etc/aria2/aria2.conf`" ]; then
    sed -i '$a bt-exclude-tracker='${blacklist} /data/etc/aria2/aria2.conf
    echo add blacklist......
else
    sed -i "s@bt-exclude-tracker=.*@bt-exclude-tracker=$blacklist@g" /data/etc/aria2/aria2.conf
    echo update blacklist......
fi
fi
/etc/init.d/aria2 start

其中服务停止启动命令和配置文件地址自行替换,该脚本同时更新了附加服务器和排除服务器。

标签: none

上一篇: 一年的流量
下一篇: 安利一个项目smartdns

添加新评论 »

*
*

欢迎评论!歡迎評論!Comments welcome!komentoj bonvenaj!댓글 오신 것을 환영합니다!
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: :cold: :cryy: :cute: :shy: :sleep: :struggle: :tea: :yahou: