Created
July 4, 2018 06:39
-
-
Save willis7/dc280cc80f341a797ab3aae1e0e0c598 to your computer and use it in GitHub Desktop.
“check that we can connect to a remote server on a particular port” Excerpt From: Lorin Hochstein. “Ansible.”
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 characters
#!/bin/bash | |
# | |
# Usage: | |
# $ “can_reach.sh www.example.com 80 1” | |
host=$1 | |
port=$2 | |
timeout=$3 | |
nc -z -w $timeout $host $port” |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment