Update gravity.sh

Signed-off-by: jpgpi250 <jpgpi250@gmail.com>
This commit is contained in:
jpgpi250 2022-04-20 10:19:44 +02:00
parent 326cd6a1f8
commit aba5e884eb

View file

@ -528,7 +528,9 @@ parseList() {
# 1. Remove all domains containing invalid characters. Valid are: a-z, A-Z, 0-9, dot (.), minus (-), underscore (_)
# 2. Append ,adlistID to every line
# 3. Ensures there is a newline on the last line
sed -e "/[^a-zA-Z0-9.\_-]/d;s/$/,${adlistID}/;/.$/a\\" "${src}" >> "${target}"
# sed -e "/[^a-zA-Z0-9.\_-]/d;s/$/,${adlistID}/;/.$/a\\" "${src}" >> "${target}"
# previous line modified 20/04/2022, see https://github.com/pi-hole/pi-hole/issues/4701
sed -e "/[^a-zA-Z0-9.\_-]/d;s/\.$//;s/$/,${adlistID}/;/.$/a\\" "${src}" >> "${target}"
# Find (up to) five domains containing invalid characters (see above)
incorrect_lines="$(sed -e "/[^a-zA-Z0-9.\_-]/!d" "${src}" | head -n 5)"