I want to delay the script execution until a certain server process is ready, which it is once it accepts incoming TCP connections.How do I test if a local TCP port is open (I get a SYN/ACK answer)? 
Test for open TCP port in bash script
shell script;networking;tcp
I would use lsof if available for this purpose. You can grep the output to check for a line of output with a LISTEN condition for the port in question. Some options may have to be passed to prevent converting port names to symbolic, etc, see man lsof for details.