Skip to content

neofob/port_listen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple script to listen on a given port

At times, you are just too tired of typing nc -l...here is the script to be used by other programs

This script, port_listen.sh, returns 1 if the listen_app does not exit after a timeout; otherwise, it returns 0. It relies on the behavior of nc/netcat, which exits once it receives a message. I think, I saw...who knows?

Usage

On a host machine mickey

$ TIMEOUT=60 PORT_NUMBER=4242 ./port_listen.sh

On a host machine minnie

$ echo "Pluto is comming" | nc -q0 mickey 4242

The counterpart of this is port_establish.

author: tuan t. pham

About

Test if we get any data if listen on a given port

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published