From 11bb752c389dac42ffcdbbef706d775101fd4d47 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Sat, 23 Aug 2008 10:45:48 +0000 Subject: Yet another bugfix on trying to resolv peer-ip from netstat information git-svn-id: svn://svn.alpinelinux.org/acf/openssh/trunk@1407 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openssh-model.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openssh-model.lua') diff --git a/openssh-model.lua b/openssh-model.lua index 1cc5598..4df9abd 100644 --- a/openssh-model.lua +++ b/openssh-model.lua @@ -170,7 +170,7 @@ function list_conn_peers() local f = io.popen( path .. 'netstat -lna | grep ' .. tostring(config.Port) .. ' | grep "ESTABLISHED"' ) for line in f:lines() do local peer = string.match(line, "^%S*%s*%S*%s*%S*%s*%S*%s*(%S*)") - peer = string.match(peer, "^.*:(%S-):%d*$") + peer = string.match(peer, "(%d*%.%d*%.%d*%.%d*):%d*$") if (peer) then if not (netstat[peer]) then netstat[peer] = {cnt=0} end netstat[peer]['cnt'] = (tonumber(netstat[peer]['cnt']) + 1) -- cgit v1.2.3