I need one easy bash script that has to enstablish connection between 2 hosts, one will act as server one will act as client, the hosts can be on the same network (trough a vpn) or one on public ip one on private ip.
The connection will set the serial speed of a tty port on both server and client and will stream all the raw data between the 2 serial ports of the 2 hosts.
SSL encription preferred but not mandatory.
Is possible to wite the sw in c instead of bash but the code and libraries must be made avilable and i must be able to recompile in case i make some small changes.
The script should be able to recognize if the connection is lost and keep trying to reconnect.
The stream must handle the lost of connection in terms that the stream must stay realtime, loss of data is acceptable in case of missing connection.
The script must run on Linux OpenWRT and Lede, use of nc or socat is ok, ser2net must be avoided.
The hardware currently is a AMD Jaguar platform (pcengines).