🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #1404

Re: Solucionado: saber cuantas conexiones por puerto con bash

#1404
From: David Serrano (Hue-Bond)
Date: Fri, 02 Dec 2005 10:12
22 lines
1583 bytes
pacolinx, jue20051124@11:32:31(CET):
>
> ip=`/sbin/ifconfig eth0 | grep "inet addr:" | awk '{print $2}' | cut -c 6-`

$ /sbin/ifconfig ofi|awk -F'[ :]' '/inet addr/{print $13}'
192.168.1.123
$ _


> c=`netstat -tupan | grep ESTA |  awk '{print $4}'| grep $ip | cut -d ":" -f2
>| grep -w $1 | wc -l`


# IP=192.168.1.123
# PORT=52030
# netstat -tupan | awk -F'[ :]' /$IP'/ && /ESTA/{$17 == '$PORT' && c++} END {print c}'
1
# _


-- 
 David Serrano
Technical Details
Message-ID: <dmp6lk$76p$1@cormoran.emeteo.local>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!news.musoftware.de!news-15.escomposlinux.org!cernicalo.escomposlinux.org!escomposlinux.org!not-for-mail
References: <lr6f53-028.ln1@aldarias.dyndns.org> <slrndo9vv6.vrn.claudio@example.org> <vehg53-mvc.ln1@aldarias.dyndns.org>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,c9c73879e9597405
X-Google-Attributes: gidf86c8,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!news.musoftware.de!news-15.escomposlinux.org!cernicalo.escomposlinux.org!escomposlinux.org!not-for-mail
From: "David Serrano (Hue-Bond)" <responder_solo_en_el_grupo@yahoo.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Solucionado: saber cuantas conexiones por puerto con bash
Date: Fri, 2 Dec 2005 10:12:04 +0000 (UTC)
Organization: I work for myself
Lines: 22
Message-ID: <dmp6lk$76p$1@cormoran.emeteo.local>
References: <lr6f53-028.ln1@aldarias.dyndns.org> <slrndo9vv6.vrn.claudio@example.org> <vehg53-mvc.ln1@aldarias.dyndns.org>
NNTP-Posting-Host: 196.red-80-33-235.staticip.rima-tde.net
X-Trace: cormoran.emeteo.local 1133518324 7385 80.33.235.196 (2 Dec 2005 10:12:04 GMT)
X-Complaints-To: emeteo@escomposlinux.org
NNTP-Posting-Date: Fri, 2 Dec 2005 10:12:04 +0000 (UTC)
X-Message-Flag: Visit http://www.debian.org/
X-MSMail-Priority: High
Mail-Copies-To: nobody
User-Agent: slrn/0.9.8.1pl1 (Debian)