From 5474e037c87f512704192f9fe06103836e2707e8 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 29 Nov 2016 21:20:05 +0200 Subject: [PATCH] Confirm current IP address. --- update_ip.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update_ip.sh b/update_ip.sh index be3ea54..10e319c 100755 --- a/update_ip.sh +++ b/update_ip.sh @@ -7,6 +7,7 @@ host=desktop secret="" ip=$(wget -q -O - http://treehouse.org.za/ip) +set_ip=$(dig +short ${host}.${zone}) if [ -z ${ip} ] || [ -z ${cache} ]; then exit; @@ -16,7 +17,7 @@ if [ -f "${HOME}/${cache}" ]; then old_ip=$(cat "${HOME}/${cache}") fi -if [ "${ip}" = "${old_ip}" ]; then +if [ "${set_ip}" = "${ip}" ] && [ "${ip}" = "${old_ip}" ]; then exit; else rm -f "${HOME}/${cache}"