1
0
Fork 0
mirror of https://github.com/tunix/digitalocean-dyndns synced 2024-12-22 21:09:52 +00:00

Compare commits

..

No commits in common. "0ed4ab05cfcbf86d44d0b3bdc4b0776b9b64583a" and "a5ae5cfe52fa519f0d77c8d88cf2169c32fd2403" have entirely different histories.

2 changed files with 4 additions and 8 deletions

View file

@ -1,6 +1,6 @@
FROM alpine
MAINTAINER Alper Kanat <me@alperkan.at>
RUN apk --no-cache add curl jq bash
MAINTAINER Alper Kanat <tunix@raptiye.org>
RUN apk --no-cache add curl jq
COPY dyndns.sh /
USER nobody
ENTRYPOINT exec /dyndns.sh

View file

@ -4,7 +4,6 @@ api_host="https://api.digitalocean.com/v2"
sleep_interval=${SLEEP_INTERVAL:-300}
services=(
"ifconfig.co"
"ipinfo.io/ip"
"ifconfig.me"
)
@ -30,10 +29,9 @@ while ( true ); do
echo "Trying with $service..."
ip="$(curl -s $service)"
test -n "$ip" && break
done
echo "Found IP address $ip"
test -n "$ip" && break
done
if [[ -n $ip ]]; then
for sub in ${NAME//;/ }; do
@ -53,8 +51,6 @@ while ( true ); do
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d "$data" \
"$url" &> /dev/null
else
echo "existing DNS record address ($record_data) did not need updating"
fi
done
else