FIX: Add error handling to detect_false_positives pipe

Line 1955: Added || true to sort command
Line 1957: Added 2>/dev/null to wc command

Prevents script exit if sort fails or false_positives.txt doesn't exist.
This commit is contained in:
Developer
2026-04-23 20:28:24 -04:00
parent dc6ce93eef
commit 8af1ca881b
+2 -2
View File
@@ -1952,9 +1952,9 @@ detect_false_positives() {
else if (match(url, /checkout|payment|paypal|stripe|square/) && match(ua, /paypal|stripe|square/)) {
print ip "|Payment Processor|" ua "|" domain
}
}' | sort -u > "$TEMP_DIR/false_positives.txt"
}' | sort -u > "$TEMP_DIR/false_positives.txt" || true
print_success "False positive detection complete ($(wc -l < "$TEMP_DIR/false_positives.txt") legitimate services identified)"
print_success "False positive detection complete ($(wc -l < "$TEMP_DIR/false_positives.txt" 2>/dev/null || echo 0) legitimate services identified)"
}
#############################################################################