Could you help me writing a script showing which network connections are currently active?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Could you help me writing a script showing which network connections are currently active?
# 1  
Old 02-04-2015
Could you help me writing a script showing which network connections are currently active?

Could you help me writing a script showing which network connections are currently active?
Means output should be something like:
"eth0, wlan1, wlan3"

Problem:
The output is supposed to happen on a 16x2 LCD Display.
Currently I am doing a "Ifconfig" as output, but its too fast for the display.
# 2  
Old 02-04-2015
Quote:
Originally Posted by lordofazeroth
Could you help me writing a script showing which network connections are currently active?
Means output should be something like:
"eth0, wlan1, wlan3"

Problem:
The output is supposed to happen on a 16x2 LCD Display.
Currently I am doing a "Ifconfig" as output, but its too fast for the display.
Use the below command instead of using only ifconfig, ifconfig output will be greped and filters the inet line to get only the IP address.

Code:
ifconfig | grep inet

Sample output is here.

Image

Last edited by babinlonston; 02-04-2015 at 07:45 AM..
# 3  
Old 02-04-2015
quick and dirty, no error checking etc, some polishing needed:
Code:
ifconfig | awk '$1 {print $1}' FS="  " ORS=,
eth0,lo,

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Network Connections

I have a static IP 47.21.154.146 and two computers which I wish to talk to each other. The two IPs are 198.168.1.5 and 198.168.1.6. How do I do it. For example ls from one computer to the other. TIA (8 Replies)
Discussion started by: Meow613
8 Replies

2. IP Networking

2 WAN connections on 1 switch/network

I want to know potential problems with the following scenario OR if it is an ok way to have my network setup: I have 2 WAN connections to the internet. I have each WAN connection plugged into its own router. Router DD-WRT is gateway for servers (192.0.10.50). Router Tomato is gateway for pc's... (1 Reply)
Discussion started by: herot
1 Replies

3. IP Networking

preferred network connections

I rotate between a static lan, dhcp lan, and various wireless networks daily. Is there a way to set preferred network connections? I use some static ip's daily, some static ip's like once a month, and almost never use the dhcp lan. The same I do with my various wireless networks. Some I use daily... (0 Replies)
Discussion started by: cokedude
0 Replies

4. Web Development

How to find number of http connections active currently in apache web server

Hi I have a solaris 9 OS with apache web server running on top of it. i want to know how many http connections are active at any point in time. (In other words how many users are accessing my website it at any moment of time) How to get it..? hit counters are not required... ----------... (0 Replies)
Discussion started by: aemunathan
0 Replies

5. Red Hat

How to kill all active tcp connections from an IP?

How to kill all active tcp connections from an IP? I am using CentOS (3 Replies)
Discussion started by: an00p
3 Replies

6. AIX

How to active this network adapter?

When I configure two VIO Servers, VIOS1 used to ping its gateway, after I configured second VIOS2, VIOS1 cannpt ping its gateway, when I run this command: entstat -all ent#|grep -i priority Priority: 5 Active: False How to make Active to True? (1 Reply)
Discussion started by: rainbow_bean
1 Replies

7. IP Networking

Logging network connections

Hello, I have a centralized syslog server, and am wondering if there is a way to log all network connections to it (Primarily incoming, such as FTP, httpd, SSH, etc). Essentially what I would like is to get the information seen in netstat or lsof logged line by line, realtime. Is there a... (3 Replies)
Discussion started by: abstrcrndm
3 Replies

8. Shell Programming and Scripting

How to get active connections in Unix

Hi All, I have to find out how many active connections with other machines are there,then list the remote machine IP address and type of connection. When u say type of connection what does it means TCP,UDP ram. then what is UNIX active connection Please let me know as soon as possible. ... (3 Replies)
Discussion started by: jatin.jain
3 Replies

9. Shell Programming and Scripting

network active shell script

can anyone help me find a script that i can use to see whether a network is up and if it aint up then create a new network. (0 Replies)
Discussion started by: king_jon85
0 Replies

10. Linux

active network connections

how can i see active network connections (1 Reply)
Discussion started by: youmna
1 Replies
Login or Register to Ask a Question