I am experiencing the same issue on free BSD. replacing
ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break
with
lsof -i :$PORT | grep LISTEN | grep -qE 'socat|nc' && break
Solved the problem. Also, the tar cmd is not compatible with FreeBSD either.
I am experiencing the same issue on free BSD. replacing
ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break
with
lsof -i :$PORT | grep LISTEN | grep -qE 'socat|nc' && break
Solved the problem.
Also, the tar cmd is not compatible with FreeBSD either.