Skip to content

Instantly share code, notes, and snippets.

@orihomie
Created August 31, 2022 09:28
Show Gist options
  • Save orihomie/128ab6111d49e0fd2ee2ae166ab8d5f7 to your computer and use it in GitHub Desktop.
Save orihomie/128ab6111d49e0fd2ee2ae166ab8d5f7 to your computer and use it in GitHub Desktop.
Simple domain check
#!/usr/bin/env bash
domains=($(cat $1 | awk '{print $1}'))
delta=1
arraylength=${#domains[@]}
for (( i=0; i<${arraylength}; i=$((i+$delta)) ));
do
host "${domains[i]}"
echo "${domains[i]} checked"
done
@orihomie
Copy link
Author

Sample domains.txt file:

google.com
ya.ru
github.com

How to run:

chmod +x check_domains.sh
./check_domains.sh domains.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment