Created
August 20, 2017 07:28
-
-
Save codezixo/6371e66dcfd6d5a75672489457b91adf to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/bash | |
dns_server="@IP DNS SERVER 1@" | |
while [ -n "$dns_server" ]; do | |
ping -q -c 1 $dns_server | while read pong; do echo "$(TZ='Europe/Moscow' date): $pong" » ./ck_dns_test.out; done | |
host -t A @DNS MANE OF YOUR HOST@ $dns_server | while read myhost; do echo "$(TZ='Europe/Moscow' date): $myhost" » ./ck_dns_test.out; echo $myhost; done | |
echo '' » ./ck_dns_test.out | |
case "$dns_server" in | |
@IP DNS SERVER 1@) | |
dns_server="@IP DNS SERVER 2@" | |
;; | |
@IP DNS SERVER 2@) | |
sleep 60 | |
echo "$(TZ='Europe/Moscow' date)" | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment