Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 182cf7ceff | |||
|
|
7ca4805578 | ||
|
|
cf46b9d581 | ||
|
|
36c916750d |
4 changed files with 14 additions and 3 deletions
BIN
lp-ddns.deb
BIN
lp-ddns.deb
Binary file not shown.
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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