Linux und macOS: wöchentlich per cron
Speichern Sie dies als ~/.aria2/update-trackers.sh:
#!/bin/sh
# Replace (or add) the bt-tracker line in aria2.conf with the current best public trackers.
CONF="${CONF:-$HOME/.aria2/aria2.conf}"
LIST=$(curl -fsSL https://cdn.jsdelivr.net/gh/ngosang/trackerslist@master/trackers_best.txt | grep -v '^$' | paste -sd, -) || exit 1
[ -n "$LIST" ] || exit 1
if grep -q '^bt-tracker=' "$CONF"; then
sed -i.bak "s#^bt-tracker=.*#bt-tracker=$LIST#" "$CONF"
else
echo "bt-tracker=$LIST" >> "$CONF"
fi
Führen Sie dann crontab -e aus und fügen Sie diese Zeile hinzu, damit das Skript jeden Montag um 04:00 läuft:
0 4 * * 1 sh $HOME/.aria2/update-trackers.sh