Created
April 11, 2017 05:16
-
-
Save jsidhu/f17d0d7db46d0625bfaab935e294143c to your computer and use it in GitHub Desktop.
Revisions
-
jsidhu created this gist
Apr 11, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #!/bin/bash HOST=$1 PORT=$2 timeout 1 bash -c "cat < /dev/null > /dev/tcp/${HOST}/${PORT}" RESULT=$? if [ "${RESULT}" -ne 0 ]; then echo "Failed: ${RESULT}" else echo "Connected: ${RESULT}" fi