Fix: Double arithmetic syntax error in generate_comparison_report (line 2073)

This commit is contained in:
Developer
2026-04-23 21:16:33 -04:00
parent 8af1ca881b
commit ca7ec62e02
12 changed files with 121 additions and 70 deletions
+6 -6
View File
@@ -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