Created
December 16, 2011 03:16
-
-
Save hirocaster/1484269 to your computer and use it in GitHub Desktop.
DNS check script
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
# -*- 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