From 825f5c96013723579a87986ecde8a7052692f00c Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Sat, 26 Mar 2022 01:37:59 +0300 Subject: [PATCH] Change z-i split from " | " to "|" --- parse.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parse.sh b/parse.sh index b9f495c..cae6f6b 100755 --- a/parse.sh +++ b/parse.sh @@ -19,7 +19,7 @@ sort -u config/include-hosts-{dist,custom}.txt > temp/include-hosts.txt sort -u config/include-ips-{dist,custom}.txt > temp/include-ips.txt sort -u temp/include-hosts.txt result/hostlist_original.txt > temp/hostlist_original_with_include.txt -awk -F ';' '{split($1, a, / \| /); for (i in a) {print a[i]";"$2}}' temp/list.csv | \ +awk -F ';' '{split($1, a, /\|/); for (i in a) {print a[i]";"$2}}' temp/list.csv | \ grep -f config/exclude-hosts-by-ips-dist.txt | awk -F ';' '{print $2}' >> temp/exclude-hosts.txt awk -f scripts/getzones.awk temp/hostlist_original_with_include.txt | grep -v -F -x -f temp/exclude-hosts.txt | sort -u > result/hostlist_zones.txt @@ -33,14 +33,14 @@ fi # Generate a list of IP addresses awk -F';' '$1 ~ /\// {print $1}' temp/list.csv | grep -P '([0-9]{1,3}\.){3}[0-9]{1,3}\/[0-9]{1,2}' -o | sort -Vu > result/iplist_special_range.txt -awk -F ';' '($1 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}/) {gsub(/ \| /, RS, $1); print $1}' temp/list.csv | \ +awk -F ';' '($1 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}/) {gsub(/\|/, RS, $1); print $1}' temp/list.csv | \ awk '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/' | sort -u > result/iplist_all.txt -awk -F ';' '($1 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}/) && (($2 == "" && $3 == "") || ($1 == $2)) {gsub(/ \| /, RS); print $1}' temp/list.csv | \ +awk -F ';' '($1 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}/) && (($2 == "" && $3 == "") || ($1 == $2)) {gsub(/\|/, RS); print $1}' temp/list.csv | \ awk '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/' | sort -u > result/iplist_blockedbyip.txt grep -F -v '33-4/2018' temp/list.csv | grep -F -v '33а-5536/2019' | \ - awk -F ';' '($1 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}/) && (($2 == "" && $3 == "") || ($1 == $2)) {gsub(/ \| /, RS); print $1}' | \ + awk -F ';' '($1 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}/) && (($2 == "" && $3 == "") || ($1 == $2)) {gsub(/\|/, RS); print $1}' | \ awk '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/' | sort -u > result/iplist_blockedbyip_noid2971.txt awk -F ';' '$1 ~ /\// {print $1}' temp/list.csv | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}\/[0-9]{1,2}' | sort -u > result/blocked-ranges.txt