Is there a method in Linux to monitor a port for activity, then when found, execute a script?

For example, when tftp port 69 is accessed, run a script that runs commands.

thank you.

Is there a method in Linux to monitor a port for activity, then when found, execute a script?

For example, when tftp port 69 is accessed, run a script that runs commands.

thank you.

You can use nmap (linux tool) to find opened ports and run required your script, or you can open perl socket (without linux tool) to required port

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.