High rise antenna?

Oh the command may still send output even though it’s in the background.
So it can be seem it’s not in the background while it actually is (background is different on the shell to what you would normally consider background)

I’ve optimized the shell script so that it terminates properly when you press CTRL-C (now the while loops will terminate as well).
Not sure why it wouldn’t run from rc.local.
I’m adding a log file too so you can check it’s running.
Note that the ports and addresses need to be modified to your situation :slight_smile:

#!/bin/bash
exec  &>>/tmp/socat.log

opts="-d -d"

echo -n "Starting data redirection with socat:    "
date

trap "kill 0" SIGINT
trap "kill -2 0" SIGTERM

while true
do
	socat $opts -u TCP:pi:30005 TCP:localhost:29999
	sleep 5
done &

while true
do
	socat $opts -u TCP:pi:30105 TCP:localhost:29999
	sleep 5
done &

wait