Merge pull request #1 from grondinm/master
Add option to specify remote NameServer to query
This commit is contained in:
commit
7ca4805578
2 changed files with 8 additions and 2 deletions
|
|
@ -2,10 +2,11 @@
|
||||||
# RECORDID="235890
|
# RECORDID="235890
|
||||||
# PASSWORD="verystrongpassword"
|
# PASSWORD="verystrongpassword"
|
||||||
# DOMAIN="sub.domain.tld"
|
# DOMAIN="sub.domain.tld"
|
||||||
|
# NAMESERVER="NameServerToQuery"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RECORDID=""
|
RECORDID=""
|
||||||
PASSWORD=""
|
PASSWORD=""
|
||||||
DOMAIN=""
|
DOMAIN=""
|
||||||
|
NAMESERVER="" #Blank for system NameServer
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,12 @@ set -e
|
||||||
|
|
||||||
IP="$(curl --connect-timeout 10 -s ipv4.is || curl --connect-timeout 10 -s ipv4.is)"
|
IP="$(curl --connect-timeout 10 -s ipv4.is || curl --connect-timeout 10 -s ipv4.is)"
|
||||||
#IP="$(curl --config /etc/lp-dyndns/curlrc)"
|
#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}"
|
APIURL="https://freedns.linux.pizza/api/v1/remote/updatepw?record=${RECORDID}&password=${PASSWORD}&content=${IP}"
|
||||||
# Making stuff fancy
|
# Making stuff fancy
|
||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue