summaryrefslogtreecommitdiffstats
path: root/openssh-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'openssh-model.lua')
-rw-r--r--openssh-model.lua2
1 files changed, 1 insertions, 1 deletions
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)