Created
June 1, 2021 13:17
-
-
Save jg3/ceaf5110eff74c866f17cbf0f18f7d74 to your computer and use it in GitHub Desktop.
DuckDNS update script and RPi-Monitor panel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this line goes in root crontab, use `crontab -e` to edit | |
# run this scripit every five minutes. | |
*/5 * * * * /etc/duckdns/duck.sh >/dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This file lives at /etc/duckdns/duck.sh | |
# Update DuckDNS hostnames with my internal and external IPs | |
MYTOKEN="00000000-0000-0000-0000-00000000000f" | |
INTIP="`hostname -I | awk '{ print $1 }'`" | |
EXTIP= | |
INTDOMAIN=jg3int | |
EXTDOMAIN=jg3 | |
echo url="https://www.duckdns.org/update?domains=$INTDOMAIN&token=$MYTOKEN&ip=$INTIP&verbose=true" | curl -k -o /var/log/duck$INTDOMAIN.log -K - | |
echo url="https://www.duckdns.org/update?domains=$EXTDOMAIN&token=$MYTOKEN&ip=$EXTIP&verbose=true" | curl -k -o /var/log/duck$EXTDOMAIN.log -K - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################## | |
# this file lives in /etc/rpimonitor/duckdns.conf | |
# and is included in /etc/rpimonitor/data.conf | |
# | |
# RPi-Monitor check to see that dynamic DNS is being updated | |
# Page: 1 | |
# Information Status Statistics | |
# - /var/log/duck*.log - yes - no | |
######################################################################## | |
dynamic.1.name=duckjg3 | |
dynamic.1.source=hear -1 /var/log/duckjg3.log | |
dynamic.1.regexp=(OK) | |
dynamic.2.name=duckjg3int | |
dynamic.2.source=head -1 /var/log/duckjg3int.log | |
dynamic.2.regexp=(OK) | |
web.status.1.content.1.name=DuckDNS | |
web.status.1.content.1.icon=ducky_icon64x64.png | |
web.status.1.content.1.line.1="<b>duckjg3</b>: "+Label(data.duckjg3,"=='OK'","OK","success")+Label(data.duckjg3,"!='OK'","KO","danger")+ " <b>duckjg3int</b>: "+Label(data.duckjg3int,"=='OK'","OK","success")+Label(data.duckjg3int,"!='OK'","KO","danger") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This gist is a few files that I use to update my DuckDNS internal and external IP addresses, | |
and report update status on the RPi-Monitor | |
References: | |
https://www.duckdns.org/ | |
https://github.com/XavierBerger/RPi-Monitor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment