Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leozhang2018/3d348528f8f9c54be9d901f444b622a0 to your computer and use it in GitHub Desktop.
Save leozhang2018/3d348528f8f9c54be9d901f444b622a0 to your computer and use it in GitHub Desktop.
Auto update aria2 tracker from github
#!/bin/bash
killall aria2c &>/dev/null
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" /aria/aria2.conf`" ]; then
sed -i '$a bt-tracker='${list} /aria/aria2.conf
echo add......starting
sleep 3
sudo -u www-data aria2c --conf-path=/aria/aria2.conf -D
ps -aux|grep aria
else
sed -i "s@bt-tracker.*@bt-tracker=$list@g" /aria/aria2.conf
echo update......starting
sleep 3
sudo -u www-data aria2c --conf-path=/aria/aria2.conf -D
ps -aux|grep aria
fi
@leozhang2018
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment