Posted by dandriff on Thursday August 30, 2012@01:13PM
HOWTO: Command-line test for whether or not a TCP port is open
Usually I just use `telnet
nc -z1>/dev/null 2>&1; result=$?; if [ $result -eq 0 ]; then echo 'the port is open for tcp connections' else echo 'the port was closed' fi
Reference: How to test if remote TCP port is opened from Shell script?