Check DuckDNS connection status/update
-
I created a bash script for my off grid HomeGenie Server similar to this which displays the Status and current IP in a widget.
It is on a DSL line so the IP does change from time to time. The url calls are posted on the DuckDNS.org site.
I converted it to a python3 Ducks.py script for TRIGGERcmd.
you'll need a free DuckDNS account and create a domain and get a token for that domain name
the script looks like this:#Libraries import requests import os url = "https://www.duckdns.org/update?domains=YOURDOMAIN&token=YOURTOKEN" result = requests.get(url) if result.text == "OK": os.system ('~/.TRIGGERcmdData/sendresult.sh ' + result.text) else: os.system ('~/.TRIGGERcmdData/sendresult.sh ' + 'Broken') # Print to commandline print (result.text)replace "YOURDOMAIN" with the one you created and replace "YOURTOKEN" with what DuckDNS asigns you.
I added this line to my commands.json text
{"trigger":"Duck D N S","command":"python3 /home/pi/scripts/Ducks.py","ground":"background","voice":"Duck D N S","voiceReply":"The Duck D N S conection is {{result}}","allowParams": "false"}
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login