upbt.sh 740 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. ##### 一键安装Caddy + Aria2 + AriaNg #####
  3. ##### 作者:xiaoz.me #####
  4. ##### 更新时间:2018-09-28 #####
  5. #导入环境变量
  6. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/sbin
  7. export PATH
  8. function up_tracker(){
  9. #下载最新的bt-tracker
  10. wget -O /tmp/trackers_best.txt https://api.xiaoz.org/trackerslist/
  11. tracker=$(cat /tmp/trackers_best.txt)
  12. #替换处理bt-tracker
  13. tracker="bt-tracker="${tracker}
  14. #更新aria2配置
  15. sed -i '/bt-tracker.*/'d /etc/ccaa/aria2.conf
  16. echo ${tracker} >> /etc/ccaa/aria2.conf
  17. echo '-------------------------------------'
  18. echo 'bt-tracker update completed.'
  19. echo '-------------------------------------'
  20. }
  21. up_tracker
  22. #重启服务
  23. /usr/sbin/ccaa restart