Fix: Double arithmetic syntax error in generate_comparison_report (line 2073)
This commit is contained in:
@@ -1311,7 +1311,7 @@ calculate_bot_fingerprint() {
|
||||
}
|
||||
close(tmpdir "/bot_fingerprints.txt")
|
||||
}
|
||||
' < "$TEMP_DIR/parsed_logs.txt"
|
||||
' < "$TEMP_DIR/parsed_logs.txt" 2>/dev/null || true
|
||||
|
||||
# Create file if empty
|
||||
touch "$TEMP_DIR/bot_fingerprints.txt"
|
||||
@@ -1997,10 +1997,10 @@ generate_statistics() {
|
||||
close(tmpdir "/top_urls_raw.txt")
|
||||
}'
|
||||
|
||||
# Sort and limit results
|
||||
sort -rn "$TEMP_DIR/top_sites_raw.txt" | head -5 > "$TEMP_DIR/top_sites.txt"
|
||||
sort -rn "$TEMP_DIR/top_ips_raw.txt" | head -5 > "$TEMP_DIR/top_ips.txt"
|
||||
sort -rn "$TEMP_DIR/top_urls_raw.txt" | head -5 > "$TEMP_DIR/top_urls.txt"
|
||||
# Sort and limit results (files may not exist if no data)
|
||||
[ -f "$TEMP_DIR/top_sites_raw.txt" ] && sort -rn "$TEMP_DIR/top_sites_raw.txt" | head -5 > "$TEMP_DIR/top_sites.txt" || touch "$TEMP_DIR/top_sites.txt"
|
||||
[ -f "$TEMP_DIR/top_ips_raw.txt" ] && sort -rn "$TEMP_DIR/top_ips_raw.txt" | head -5 > "$TEMP_DIR/top_ips.txt" || touch "$TEMP_DIR/top_ips.txt"
|
||||
[ -f "$TEMP_DIR/top_urls_raw.txt" ] && sort -rn "$TEMP_DIR/top_urls_raw.txt" | head -5 > "$TEMP_DIR/top_urls.txt" || touch "$TEMP_DIR/top_urls.txt"
|
||||
|
||||
# Top 5 bots by request count (single decompression)
|
||||
cat "$TEMP_DIR/classified_bots.txt" 2>/dev/null | awk -F'|' '$9 != "unknown" {print $10}' | \
|
||||
@@ -2070,7 +2070,7 @@ generate_comparison_report() {
|
||||
echo " Baseline (7-day avg): $baseline_requests requests"
|
||||
echo " Today: $total_requests requests"
|
||||
elif [ "$request_pct" -lt 50 ]; then
|
||||
echo "🟢 LOW: Requests are $(($((100 - $request_pct))))% below baseline"
|
||||
echo "🟢 LOW: Requests are $((100 - $request_pct))% below baseline"
|
||||
else
|
||||
echo "🟡 NORMAL: Requests within expected range"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user