-
Notifications
You must be signed in to change notification settings - Fork 1
/
update_data.sh
26 lines (26 loc) · 902 Bytes
/
update_data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
mkdir download
touch download/temp.txt
touch trackerslist.txt
while read -r url; do
echo "" >>download/temp.txt
TEST=$(curl -s "$url")
if [ "$?" = "0" ] && echo "$TEST" | grep -qE "[^ ]+://[^ ]+"; then
if echo "$TEST" | grep -E "githubstatus|github|twitter"; then
echo "curl failed."
else
if echo "$TEST" | grep "udp://"; then
echo "$TEST" | grep -Eo "[^ ]+://[^ ]+" >>download/temp.txt
fi
fi
fi
echo "" >>download/temp.txt
done <url.txt
cat trackerslist.txt >>download/temp.txt
echo "" >>download/temp.txt
sort -u download/temp.txt | grep -Eo "[^ ]+://[^ ]+" >trackerslist.txt
rm -rf download
sha256sum trackerslist.txt | cut -d" " -f1 >trackerslist.txt.sha256sum
rm trackerslist.txt.xz
xz -9 -k -e trackerslist.txt
sha256sum trackerslist.txt.xz | cut -d" " -f1 >trackerslist.txt.xz.sha256sum