diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-09-24 15:55:10 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-09-24 15:55:10 +0000 |
commit | 178d62eb57bbee38f476bd8c4d081439cf0d7e95 (patch) | |
tree | 8ed83bd9120fcf5d634176f4272a4d582ba0b611 /openssh-model.lua | |
parent | 651ba7cce4fd5bc01edf6902e0f08c7c93527d00 (diff) | |
download | acf-openssh-178d62eb57bbee38f476bd8c4d081439cf0d7e95.tar.bz2 acf-openssh-178d62eb57bbee38f476bd8c4d081439cf0d7e95.tar.xz |
Modified openssh details to not show outgoing connections.
git-svn-id: svn://svn.alpinelinux.org/acf/openssh/trunk@1490 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'openssh-model.lua')
-rw-r--r-- | openssh-model.lua | 8 |
1 files 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") |