Skip navigation

Tag Archives: cloudflare

Simple tool:  I found I needed a way to keep tabs on when a DNS changed happened.  Knowing that the current site is hosted on a CloudFlare setup, I found that using curl to read the header, it gave me the server type.  Well, all I needed to know when that server type changed and I can go ahead with the rest of my setup.  This simple bash script works well for it’s basic purpose.

  1. while [ 1 ]; do
  2.         curl -Is  > test-curl.log
  3.         date >> test-curl-results.log
  4.         head -2 test-curl.log | tail -1 >> test-curl-results.log
  5.         notify-send “$(grep Server: test-curl.log | cut -c9-)”
  6.      sleep 1m
  7. done

When I see the change, I simply just stop the script from running.  If the change happens while I’m sleeping, I can see when it officially changes over.  If you have use for it, then enjoy it!

*currently set to 1m for testing.  Change to suit.

Advertisements