diff --git a/mounts/ddclient/config/ddclient.conf.tpl b/mounts/ddclient/config/ddclient.conf.tpl index c06bb17..8a36ef4 100644 --- a/mounts/ddclient/config/ddclient.conf.tpl +++ b/mounts/ddclient/config/ddclient.conf.tpl @@ -5,8 +5,8 @@ ssl=yes # use ssl-support. Works with # ssl-library postscript=/data/postscript_gotify.sh # run script after updating. The # new IP is added as argument. - -usev4=webv4 +use=web +web=googledomains ## ## CloudFlare (www.cloudflare.com) diff --git a/mounts/ddclient/data/postscript_gotify.sh b/mounts/ddclient/data/postscript_gotify.sh index 0773400..f4ad344 100755 --- a/mounts/ddclient/data/postscript_gotify.sh +++ b/mounts/ddclient/data/postscript_gotify.sh @@ -1,7 +1,12 @@ #!/bin/bash -curl -s "$GOTIFY_ADDRESS/message" \ - -X POST \ - -H "X-Gotify-Key: $GOTIFY_TOKEN" \ - -F "title=IP Address updated" \ - -F "message=IP address detected as $1" \ - -F "priority=5" + +if [ "$(cat /data/gotify_previous_ip || true)" != "$1" ]; then + echo -n "$1" > /data/gotify_previous_ip + + curl -s "$GOTIFY_ADDRESS/message" \ + -X POST \ + -H "X-Gotify-Key: $GOTIFY_TOKEN" \ + -F "title=IP Address updated" \ + -F "message=IP address detected as $1" \ + -F "priority=5" +fi