sneak.berlin-dns-blocklist/generate.sh
2025-07-15 12:45:15 +02:00

15 lines
288 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P )"
HOSTS="$(awk '{ sub(/#.*/,""); if (NF) print }' $DIR/hostlists/*.txt | sort | uniq)"
for HOST in $HOSTS ; do
if [[ "$HOST" != "localhost" ]]; then
echo "127.0.0.1 $HOST"
fi
done