diff --git a/blockip/bip b/blockip/bip index 83e3eb0..7f2d60f 100644 Binary files a/blockip/bip and b/blockip/bip differ diff --git a/blockip/bip-static b/blockip/bip-static index 5183dfd..9af1c10 100644 Binary files a/blockip/bip-static and b/blockip/bip-static differ diff --git a/blockip/src/stats.c b/blockip/src/stats.c index e3ae2e2..213e0e5 100644 --- a/blockip/src/stats.c +++ b/blockip/src/stats.c @@ -11,8 +11,8 @@ void show_active_bans(void) { char command[MAX_COMMAND_LEN]; snprintf(command, sizeof(command), "{ nft list set %s %s 2>/dev/null; nft list set %s %s 2>/dev/null; } | " - "grep -E 'expires [0-9]+(s|m|h|d|ms)' | " - "awk '{ip=\"\"; time=\"\"; for(i=1;i<=NF;i++) { if($i==\"expires\") time=$(i+1); else if(index($i,\".\")>0 || index($i,\":\")>0) ip=$i } if(ip && time) print ip\" \"time}'", + "sed 's/,//g' | grep -E 'expires [0-9]+(s|m|h|d|ms)' | " + "awk '{ip=\"\"; time=\"\"; for(i=1;i<=NF;i++) { if($i==\"expires\") time=$(i+1); else if($i==\"timeout\") ip=$(i-1) } if(ip && time) print ip\" \"time}'", NFT_TABLE, NFT_SET, NFT_TABLE, NFT_SET_V6); FILE *fp = popen(command, "r");