I am using nc command in my Linux box like below to check if a port is listening; This displays success message: nc -z 192.168.0.2 9000 This displays 0: echo $? I have combined it in a shell scr…
https://stackoverflow.com/questions/42377276/how-to-display-nc-return-value-in-linux-shell-script

