I check for a listening port on a service prior to running a script using this :
until nc -z $HOST $PORT
do
echo "waiting for service to be available..."
sleep 0.5
done
exec "/my/script"
It used to work with gnu-netcat, but now, I've upgraded the Linux distribution, and it uses nmap-ncat for the /usr/bin/nc command.
I'd like to know an equivalent solution to use with nmap-ncat package.