cloudflare_dns: fix #1
This commit is contained in:
parent
e723719db5
commit
7fb2355b1a
@ -22,6 +22,13 @@ function error() {
|
|||||||
echo "$(date --iso-8601=minutes) CLOUDFLARE_DNS_UPDATE [ERROR]: ${*}"
|
echo "$(date --iso-8601=minutes) CLOUDFLARE_DNS_UPDATE [ERROR]: ${*}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_internet_access() {
|
||||||
|
wget -q --spider https://google.com
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
error "No internet connection. Exiting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function check_new_ip() {
|
function check_new_ip() {
|
||||||
local new_ip
|
local new_ip
|
||||||
@ -37,6 +44,7 @@ function check_new_ip() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_internet_access
|
||||||
check_new_ip
|
check_new_ip
|
||||||
|
|
||||||
curl_answer="$(curl --request PATCH \
|
curl_answer="$(curl --request PATCH \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user