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:
@@ -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)"
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
|
||||
Reference in New Issue
Block a user