Is there an easy way to start bash skript if linux get input connection in specified port?
- User
Is there an easy way to start bash skript if linux get input connection in specified port?
- Assistant
- User
Is it possible to reply with plaintext on the connection after the skipt execution?
- Assistant
Yes, it is indeed possible to send a plaintext response back to the client after executing a script when a connection is made to a specified port. Both
netcatandsocatcan handle this functionality. Below are examples using both tools: - User
I meant if client accessed my machine with tcp I need to executive skript and send message to this client back within the same tcp connection.
- Assistant
To execute a script and send a response back to the client within the same TCP connection, both and can be employed for this purpose. Here's how you can achieve that using each tool:
- User
Can I terminate this connection after sending the response back? Can I execute another skip or command from this skript on my local machine? Are you sure than echo command in this skript will send the echo response back through tcp?
- Assistant
- User
I need first to execute background procesd from this skript, then send my responce back and terminate skript and connection but not my background process. Is it possible?
- Assistant