Skip to content

Instantly share code, notes, and snippets.

@hirocaster
Created December 16, 2011 03:16
Show Gist options
  • Save hirocaster/1484269 to your computer and use it in GitHub Desktop.
Save hirocaster/1484269 to your computer and use it in GitHub Desktop.
DNS check script
# -*- coding: utf-8 -*-
require 'resolv'
old = Resolv.getaddress("hiroki.jp").to_s
p old
begin
now = Resolv.getaddress("hiroki.jp").to_s
sleep(1)
p now
end while old == now
system "growlnotify -t \'IP変更のお知らせ\' -m \'#{old.to_s} to #{now.to_s} \' -s"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment