Merge pull request #1 from grondinm/master

Add option to specify remote NameServer to query
This commit is contained in:
selea 2021-02-16 19:44:56 +01:00 committed by GitHub
commit 7ca4805578
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

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)"
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'