This commit is contained in:
goldsquid
2025-12-06 14:38:20 +07:00
parent 4f6aed41d7
commit 70928ab425

View File

@@ -71,7 +71,11 @@ if [ -n "$filter_network" ] || [ -n "$filter_chain" ]; then
condition_parts+=(".chain == \"$filter_chain\"")
fi
# Join conditions with " and "
condition_str=$(IFS=" and "; echo "${condition_parts[*]}")
if [ ${#condition_parts[@]} -eq 1 ]; then
condition_str="${condition_parts[0]}"
elif [ ${#condition_parts[@]} -eq 2 ]; then
condition_str="${condition_parts[0]} and ${condition_parts[1]}"
fi
jq_filter=".[] | select($condition_str)"
fi