The subject pretty much says it all. I’m searching for a method to perform some actions on my linux machine upon connection to a netcat listener, such as sending an e-mail/sms notification.
The best I’ve been able to come up with would be setup some pipes as the input/output to the listener, and have a shell script running which monitors those pipes, but I was hoping the linux guru’s here might have something a bit more elegant.
As @lantern-shadowclaw pointed out, you can use pipes, otherwise, if netcat is not a strict requirement, you can use socket units with systemd, listening on a port of choice and activating a service for each connection (or event).