mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
commit
1f34203167
1 changed files with 4 additions and 1 deletions
|
@ -289,7 +289,10 @@ function gravity_advanced() {
|
||||||
# This helps with that and makes it easier to read
|
# This helps with that and makes it easier to read
|
||||||
# It also helps with debugging so each stage of the script can be researched more in depth
|
# It also helps with debugging so each stage of the script can be researched more in depth
|
||||||
echo -n "::: Formatting list of domains to remove comments...."
|
echo -n "::: Formatting list of domains to remove comments...."
|
||||||
awk '($1 !~ /^#/) { if (NF>1) {print $2} else {print $1}}' ${piholeDir}/${matterAndLight} | sed -nr -e 's/\.{2,}/./g' -e '/\./p' > ${piholeDir}/${supernova}
|
#awk '($1 !~ /^#/) { if (NF>1) {print $2} else {print $1}}' ${piholeDir}/${matterAndLight} | sed -nr -e 's/\.{2,}/./g' -e '/\./p' > ${piholeDir}/${supernova}
|
||||||
|
#Above line does not correctly grab domains where comment is on the same line (e.g 'addomain.com #comment')
|
||||||
|
#Add additional awk command to read all lines up to a '#', and then continue as we were
|
||||||
|
cat ${piholeDir}/${matterAndLight} | awk -F'#' '{print $1}' | awk '($1 !~ /^#/) { if (NF>1) {print $2} else {print $1}}' | sed -nr -e 's/\.{2,}/./g' -e '/\./p' > ${piholeDir}/${supernova}
|
||||||
echo " done!"
|
echo " done!"
|
||||||
|
|
||||||
numberOf=$(wc -l < ${piholeDir}/${supernova})
|
numberOf=$(wc -l < ${piholeDir}/${supernova})
|
||||||
|
|
Loading…
Reference in a new issue