I don't understand how to properly setup a data transmission between two host with unstable ethernet connection.
This is my
#!/bin/bash while [ true ]; do cat /dev/virtual | nc -v 192.168.1.1 5005 || echo "nc failed" && exit sleep 5s done exit
If I manually start it and on the destination
netcat isn't running it would say:
5005 (tcp) failed: Connection refused
But it would not exit.
I need it the other way:
netcatconnection is ok.
- then pipe
Is there a way to catch the
netcat status and then if it is
failed: connection refused restart the main bash script?