.
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
FROM golang:latest
|
||||||
|
WORKDIR /root
|
||||||
|
ADD ddns.bash .
|
||||||
|
CMD [ "/root/ddns.bash" ]
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
docker pull golang:latest
|
||||||
|
docker build -t primal/ddns .
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
networks:
|
||||||
|
ddns:
|
||||||
|
|
||||||
|
services:
|
||||||
|
ddns:
|
||||||
|
build: .
|
||||||
|
env_file:
|
||||||
|
- env
|
||||||
|
hostname: apps_ddns
|
||||||
|
image: ${IMAGE}:${VERSION}
|
||||||
|
networks:
|
||||||
|
- ddns
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
DOMN=primal.host
|
||||||
|
PASS=35f5fa4e1fc04d539260a4afaeb42371 \
|
||||||
|
IP0=''
|
||||||
|
while true ; do
|
||||||
|
IP1=$(curl --no-progress-meter 'https://api.ipify.org?format=text')
|
||||||
|
if [[ "${IP1}" != "${IP0}" && "${IP1}" != '' ]] ; then
|
||||||
|
OP0=$(curl --no-progress-meter -X GET -d 'host=@' -d "domain=${DOMN}" -d "password=${PASS}" -d "ip=${IP1}" -G 'https://dynamicdns.park-your-domain.com/update')
|
||||||
|
OP1=$(curl --no-progress-meter -X GET -d 'host=*' -d "domain=${DOMN}" -d "password=${PASS}" -d "ip=${IP1}" -G 'https://dynamicdns.park-your-domain.com/update')
|
||||||
|
echo $(date) ${IP0} ${IP1}
|
||||||
|
IP0=${IP1}
|
||||||
|
else
|
||||||
|
echo $(date) ${IP0} ${IP1} .
|
||||||
|
fi
|
||||||
|
sleep 3661
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user