socat TCP server
by dwilkinson80 from LinuxQuestions.org on (#52BHD)
Hi
I have a command running on a raspberry pi, it works great. If I use packet sender I can send TCP strings to the RPI and it runs the script as per the below. It currently runs when sending any string or even a blank string I think it just needs something to establish a connection on TCP 2023.
What I was hoping for was a simple addition to the below that would make it only run the script if a certain TCP string was received?
For example, send string of "playmusic" to TCP 2023 of the RPI and it runs the below command.
Code:socat -u tcp-l:2023,fork system:/home/pi/Music/test.shThanks in advance,
Daniel


I have a command running on a raspberry pi, it works great. If I use packet sender I can send TCP strings to the RPI and it runs the script as per the below. It currently runs when sending any string or even a blank string I think it just needs something to establish a connection on TCP 2023.
What I was hoping for was a simple addition to the below that would make it only run the script if a certain TCP string was received?
For example, send string of "playmusic" to TCP 2023 of the RPI and it runs the below command.
Code:socat -u tcp-l:2023,fork system:/home/pi/Music/test.shThanks in advance,
Daniel