Skip to content

Instantly share code, notes, and snippets.

@patsevanton
Created February 16, 2022 07:00
Show Gist options
  • Save patsevanton/c414863a127c25aab916271230f1df6e to your computer and use it in GitHub Desktop.
Save patsevanton/c414863a127c25aab916271230f1df6e to your computer and use it in GitHub Desktop.
check-connection-by-list-ip
#!/bin/bash
declare -a arr=("10.0.0.01" "10.0.0.2" "10.0.0.3")
#sudo yum install -y nc
for i in "${arr[@]}"
do
nc -w 2 -v "$i" 80 >> 1.txt 2>&1
nc -w 2 -v "$i" 443 >> 1.txt 2>&1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment