mirror of
https://github.com/milleruk/adguard-filter-list.git
synced 2026-06-03 20:31:39 +00:00
39 lines
827 B
Bash
Executable File
39 lines
827 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Navigate to blocklist directory
|
|
cd /home/adguard-filter-list/
|
|
|
|
# Make sure we have latest repo
|
|
git pull
|
|
|
|
# Download the oisd.txt file
|
|
oisd_url="https://big.oisd.nl"
|
|
oisd_file="../oisd.txt"
|
|
|
|
echo "Downloading oisd.txt from $oisd_url..."
|
|
curl $oisd_url -o $oisd_file
|
|
|
|
|
|
# Verify the download
|
|
if [[ $? -ne 0 || ! -f $oisd_file ]]; then
|
|
echo "Error: Failed to download oisd.txt from $oisd_url"
|
|
exit 1
|
|
else
|
|
echo "Successfully downloaded $oisd_file"
|
|
fi
|
|
|
|
# Create compiled blocklist
|
|
time /usr/local/bin/hostlist-compiler -v -c hostlist-compiler-config.json -o blocklist
|
|
|
|
sed -i '/^@@/d' blocklist
|
|
sed -i '/^$/d' blocklist
|
|
|
|
# Date and time
|
|
currentDate=`/bin/date '+%Y-%m-%d'`
|
|
currentTime=`/bin/date '+%H:%M:%S'`
|
|
|
|
# Push it to GitHub
|
|
git add *
|
|
git commit -m "Blocklist update ${currentDate} ${currentTime}"
|
|
git push
|