Rename to make more sense

This commit is contained in:
2024-12-05 23:31:27 +08:00
parent 9f6182ca9f
commit 02da3cf54d

View File

@ -4,7 +4,7 @@
while read -r LINE while read -r LINE
do do
GREP_EXPR=$( printf "%s" "$LINE" | tr ',' '|' ) GREP_EXPR=$( printf "%s" "$LINE" | tr ',' '|' )
PASS_RULES=0 MATCH_COUNT=0
# Loop through rules and find a breaking rule # Loop through rules and find a breaking rule
while read -r RULE while read -r RULE
do do
@ -12,14 +12,14 @@
if [[ $GREPC -ne 1 ]] if [[ $GREPC -ne 1 ]]
then then
#printf "%s rule violated for %s \n" "$RULE" "$LINE" #printf "%s rule violated for %s \n" "$RULE" "$LINE"
PASS_RULES=1 MATCH_COUNT=1
break break
fi fi
# Filter rules that only has included pages # Filter rules that only has included pages
done <<< "$( < input-rules grep -E "($GREP_EXPR)\\|($GREP_EXPR)" | sed 's/|/,.*/')" done <<< "$( < input-rules grep -E "($GREP_EXPR)\\|($GREP_EXPR)" | sed 's/|/,.*/')"
# Don't process for valid lines # Don't process for valid lines
[[ $PASS_RULES -eq 0 ]] && continue [[ $MATCH_COUNT -eq 0 ]] && continue
printf "%s\n" "$LINE" printf "%s\n" "$LINE"
done < input-updates done < input-updates