Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
adysec authored Aug 18, 2024
1 parent 298de2d commit d721e11
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
- main
schedule:
- cron: '0 12 * * *'

env:
innoextract_version: 1.9
arch: amd64

permissions:
contents: write

Expand All @@ -29,7 +29,26 @@ jobs:
curl https://raw.githubusercontent.com/chenjia404/CnTrackersList/master/all.txt >> trackers_all.txt
curl https://raw.githubusercontent.com/hezhijie0327/Trackerslist/main/trackerslist_tracker.txt >> trackers_all.txt
sort trackers_all.txt | uniq > tmp.txt
mv tmp.txt trackers_all.txt
mv tmp.txt trackers_all.txt
- name: Test tracker availability
shell: bash
run: |
> trackers_best.txt
while IFS= read -r tracker; do
if [[ "$tracker" == http* ]]; then
# Check HTTP/HTTPS tracker
if curl --connect-timeout 10 --max-time 10 -sI "$tracker" | grep -q "HTTP/"; then
echo "$tracker" >> trackers_best.txt
fi
elif [[ "$tracker" == udp* ]]; then
# Check UDP tracker
tracker_url=$(echo "$tracker" | sed 's/udp:\/\///')
if echo -n '' | nc -w 3 -u "${tracker_url%%:*}" "${tracker_url##*:}"; then
echo "$tracker" >> trackers_best.txt
fi
fi
done < trackers_all.txt
- name: Commit and Push changes
run: |
Expand Down

0 comments on commit d721e11

Please sign in to comment.