Compare commits

...

4 commits
0.5 ... master

Author SHA1 Message Date
182cf7ceff new .deb file 2021-07-02 10:59:26 +02:00
selea
7ca4805578
Merge pull request #1 from grondinm/master
Add option to specify remote NameServer to query
2021-02-16 19:44:56 +01:00
Marc Grondin
cf46b9d581 Add option to specify remote NameServer to query.
This helps in the case that the NameServer on the
system running lp-ddns uses a local NameServer and
resolves to local IP for the domain in question.

Signed-off-by: Marc Grondin <myself@marcg.pizza>
2020-10-14 21:22:46 -03:00
selea
36c916750d
Update lp-ddns
Acknownledge differences in how different distros use cron.d
2020-06-07 23:20:21 +02:00
4 changed files with 14 additions and 3 deletions

Binary file not shown.

View file

@ -1 +1,6 @@
*/30 * * * /usr/local/bin/lp-ddns >/dev/null 2>&1
# Please modify this according to your needs.
# This crontab works on Debian, but certain distro may interpret this differently.
#@reboot /usr/local/bin/lp-ddns >/dev/null 2>&1
#*/30 * * * /usr/local/bin/lp-ddns >/dev/null 2>&1

View file

@ -2,10 +2,11 @@
# RECORDID="235890
# PASSWORD="verystrongpassword"
# DOMAIN="sub.domain.tld"
# NAMESERVER="NameServerToQuery"
RECORDID=""
PASSWORD=""
DOMAIN=""
NAMESERVER="" #Blank for system NameServer

View file

@ -14,7 +14,12 @@ set -e
IP="$(curl --connect-timeout 10 -s ipv4.is || curl --connect-timeout 10 -s ipv4.is)"
#IP="$(curl --config /etc/lp-dyndns/curlrc)"
CURRENTIP="$(dig ${DOMAIN} +short)"
if [ "${NAMESERVER}" = "" ];
then
CURRENTIP="$(dig ${DOMAIN} +short)"
else
CURRENTIP="$(dig @${NAMESERVER} ${DOMAIN} +short)"
fi
APIURL="https://freedns.linux.pizza/api/v1/remote/updatepw?record=${RECORDID}&password=${PASSWORD}&content=${IP}"
# Making stuff fancy
NC='\033[0m'