Confirm current IP address.
This commit is contained in:
parent
d8d73c34b1
commit
5474e037c8
@ -7,6 +7,7 @@ host=desktop
|
|||||||
secret=""
|
secret=""
|
||||||
|
|
||||||
ip=$(wget -q -O - http://treehouse.org.za/ip)
|
ip=$(wget -q -O - http://treehouse.org.za/ip)
|
||||||
|
set_ip=$(dig +short ${host}.${zone})
|
||||||
|
|
||||||
if [ -z ${ip} ] || [ -z ${cache} ]; then
|
if [ -z ${ip} ] || [ -z ${cache} ]; then
|
||||||
exit;
|
exit;
|
||||||
@ -16,7 +17,7 @@ if [ -f "${HOME}/${cache}" ]; then
|
|||||||
old_ip=$(cat "${HOME}/${cache}")
|
old_ip=$(cat "${HOME}/${cache}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${ip}" = "${old_ip}" ]; then
|
if [ "${set_ip}" = "${ip}" ] && [ "${ip}" = "${old_ip}" ]; then
|
||||||
exit;
|
exit;
|
||||||
else
|
else
|
||||||
rm -f "${HOME}/${cache}"
|
rm -f "${HOME}/${cache}"
|
||||||
|
Loading…
Reference in New Issue
Block a user