Skip to content

Update hosts blocklist #1465

Update hosts blocklist

Update hosts blocklist #1465

Workflow file for this run

name: "Update hosts blocklist"
on:
push:
branches: ["*"]
schedule:
- cron: "0 0 * * *"
jobs:
main:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Update hosts blocklist"
run: |
echo -e 'Automatic hosts blocklist update\n' >> commit.txt
echo 'Sources:' >> commit.txt
for url in $(curl --silent --show-error 'https://v.firebog.net/hosts/lists.php?type=tick'); do
echo " - '${url}'" >> commit.txt
curl --silent --show-error "${url}" \
| sed 's/#.*//g' \
| sed 's/\s*$//g' \
| sed 's/^.*\s//g' \
| sed 's/[^a-zA-Z0-9.\-]//g' \
| sed '/^\s*$/d' \
| sed '/^localhost$/d' \
>> hosts.tmp
done
sort hosts.tmp | uniq | sed 's/^/0.0.0.0 /g' > hosts
git config user.name github-actions
git config user.email [email protected]
git add hosts
git commit --allow-empty --file commit.txt
git push