From 178d62eb57bbee38f476bd8c4d081439cf0d7e95 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 24 Sep 2008 15:55:10 +0000 Subject: Modified openssh details to not show outgoing connections. git-svn-id: svn://svn.alpinelinux.org/acf/openssh/trunk@1490 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openssh-model.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openssh-model.lua b/openssh-model.lua index 4aac198..71bebdd 100644 --- a/openssh-model.lua +++ b/openssh-model.lua @@ -125,11 +125,11 @@ function list_conn_peers() local ps = {} local who = {} config = read_config() - local f = io.popen( path .. 'netstat -lna | grep ":' .. tostring(config.value.Port.value) .. ' " | grep "ESTABLISHED"' ) + local f = io.popen( path .. 'netstat -lna | 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, "(%d+%.%d+%.%d+%.%d+):%d*$") - if peer then + local loc, peer = string.match(line, "^%S+%s+%S+%s+%S+%s+(%S+)%s+(%S+)") + peer = string.match(peer, "%d+%.%d+%.%d+%.%d+") + if string.find(loc, ":"..config.value.Port.value.."$") and peer then if not netstat[peer] then local g = io.popen( path .. "dnsname " .. peer) local name = g:read("*l") -- cgit v1.2.3