linuxserver / docker-ddclient

GNU General Public License v3.0
139 stars 36 forks source link

Add 'sample-get-ip-from-fritzbox' (closes #37) #47

Closed sepo83 closed 3 years ago

sepo83 commented 3 years ago

linuxserver.io



Description:

This PR adds the sample-get-ip-from-fritzbox script from the original ddclient repo and copies it to /etc/ddclient/get-ip-from-fritzbox as suggested in the comments of that script.

Benefits of this PR and context:

Getting the public IP from a fritz.box is a common usecase (at least in Germany). #37 in general complained that container-init deletes execute-rights for scripts in the /config folder. However, the root cause is that the sample-get-ip-from-fritzbox script is not distributed in this container.

How Has This Been Tested?

Tested on Debian 5.6.14-2~bpo10+1 (2020-06-09) x86_64 GNU/Linux with docker-compose as suggested in documentation and FritzBox 6430.

Added use=cmd, cmd=/etc/ddclient/get-ip-from-fritzbox to /config/ddclient.conf

ddclient -daemon=0 -file=/config/ddclient.conf -query then returns:

use=if, if=eth0 address is <my-local-ip>
use=if, if=lo address is 127.0.0.1
WARNING:  cannot connect to ipdetect.dnspark.com:80 socket: IO::Socket::INET: Bad hostname 'ipdetect.dnspark.com'
WARNING:  found neither ipv4 nor ipv6 address
use=web, web=dnspark address is NOT FOUND
use=web, web=dyndns address is <my-public-ip>
use=web, web=loopia address is <my-public-ip>
use=cmd, cmd=/etc/ddclient/get-ip-from-fritzbox address is <my-public-ip>

Source / References:

37

LinuxServer-CI commented 3 years ago

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/ddclient/v3.9.1-pkg-2bc01849-pr-47/index.html https://ci-tests.linuxserver.io/lspipepr/ddclient/v3.9.1-pkg-2bc01849-pr-47/shellcheck-result.xml

Roxedus commented 3 years ago

It would be nice if wrote a short text on how to use this in the application setup, so people dont have to look at this PR to find out :)

sepo83 commented 3 years ago

Added / updated the documentation with a short how-to and added a link to the ddclient documentation. I hope I edited the right file :smiley: ...

Roxedus commented 3 years ago

Yup that's the right file :)

LinuxServer-CI commented 3 years ago

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/ddclient/v3.9.1-pkg-2bc01849-pr-47/index.html https://ci-tests.linuxserver.io/lspipepr/ddclient/v3.9.1-pkg-2bc01849-pr-47/shellcheck-result.xml