diff --git a/.bin/update-adlist b/.bin/update-adlist index cda65e5..c65d5ba 100755 --- a/.bin/update-adlist +++ b/.bin/update-adlist @@ -2,7 +2,7 @@ trap _restore_all 1 2 3 6 -_list=${1:-/etc/unwind/blocklistproject.txt} +_list=/etc/unwind/blocklistproject.txt _url=https://blocklistproject.github.io/Lists/alt-version _dir=/etc/unwind/lists @@ -41,6 +41,7 @@ _download() { doas ftp -V -o "$_dir/$_file" "$_url/$_file" > /dev/null \ && doas rm -f "$_dir/$_file.old" } + _disabled() { if echo "$1" | grep -q "^#" then @@ -51,11 +52,15 @@ _disabled() { fi return 1 } + _assemble() { echo "Assemble blocklist: /etc/unwind/_assembled.txt" cat $_dir/*.txt \ | tr -d " " \ | grep -v '^#' \ + | grep -v '^-' \ + | grep -v '^$' \ + | cut -d "#" -f1 \ | doas sort -uo /etc/unwind/_assembled.txt } _restart_unwind() {