Skip to content

Commit 9d5bbb4

Browse files
committed
fix(v2): Patch dos2unix conversion and domain greping
1 parent 48a6ec0 commit 9d5bbb4

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

docker/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ WORKDIR /root
244244
RUN find -P -O3 /var/log -depth -type f -print0 | xargs -0 -r truncate -s 0; \
245245
find -P -O3 /etc/ /usr/ -type d -empty -delete
246246

247-
RUN printf '#!/bin/sh\nset -eu\nquiet=false\nwhile [ "$#" -gt 0 ]; do\n case "$1" in\n -q) quiet=true; shift ;;\n --) shift; break ;;\n -*)\n printf "dos2unix: unsupported option %%s\\\\n" "$1" >&2\n exit 1\n ;;\n *)\n break\n esac\ndone\nif [ "$#" -eq 0 ]; then\n mawk '\''sub(/\r\n?/, ""); print'\''\nelse\n for file in "$@"; do\n tmp=$(mktemp)\n mawk '\''sub(/\r\n?/, ""); print'\'' "$file" >"$tmp"\n mv "$tmp" "$file"\n done\nfi\n' > /usr/local/bin/dos2unix && \
248-
chmod +x /usr/local/bin/dos2unix
249-
250247
RUN install -d -m 0700 /home/nonroot/.parallel && \
251248
cp /root/.parallel/will-cite /home/nonroot/.parallel/will-cite && \
252249
cp -r /root/.config /home/nonroot/.config && \

scripts/v2/apply_filters.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://unix.stackexchange.com/questions/459127/grep-to-extract-lines-that-contains-full-domain-names-from-a-file
44
# IpInfo's 'grepdomain' includes IPv4 addresses
55
get_domains() {
6-
grep -P "^.[^.]+\.[a-zA-Z]{3}$|^.[^.]+\.[a-zA-Z]{2}\.[a-zA-Z]{2}$"
6+
grep -E "^.[^.]+\.[a-zA-Z]{3}$|^.[^.]+\.[a-zA-Z]{2}\.[a-zA-Z]{2}$"
77
}
88

99
# NOTE: "include-cidrs" ignores CIDR blocks!
@@ -91,7 +91,7 @@ process_list() {
9191
'ESOX_LUCIUS') unzip -p "$FILE_PATH" 'PiHoleblocklists-main/*' -x PiHoleblocklists-main/LICENSE PiHoleblocklists-main/README.md ;;
9292
'PENGELANA') unzip -p "$FILE_PATH" 'blocklist-master/src/blacklist/blocklists-*.txt' ;;
9393
esac |
94-
dos2unix -q |
94+
tr -d '\r' |
9595
case "$CONTENT_TYPE" in
9696
'TEXT')
9797
case "$LIST_FILTER" in

0 commit comments

Comments
 (0)