You have several options for checking the status of your DynDNS. Here are a few:
- Use curl to check the status. If any of the commands above return an error, send a no reply notification with that error message.
``
# Get latest stats from google
echo {status:"NO_CHANGE"} | curl -s -I http://www.google.com
`
- For Telegram, use python as indicated by the [python section](#python) in the main doc.
`
bash
run {python} /root/.hermes/python/cf.py dynnads 2>&1
`
- Discord webhook: Use a Discord bot to monitor DynDNS and trigger messages for changes. Here is how you can create a bot using [Discord py-args](https://docs.discords.py-args.org/en/latest/):
`
bash
run {python} /root/.hermes/python/cf-bot.py --config discord-dns-config.json dynnads 2>&1 discord webhook:1003980922525 telegram:-1003980922525 telegram:1812605657
`
This will automatically send notifications to three recipients when DynDNS changes.
`
pythonfile
import discord
class DnnBot:
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc_value, traceback):
bot = await self.load_bot()
await bot.change_presence(activity=discordActivitiesstatus())
channel = bot.get_channel(123456789000) # Replace with the actual server ID
for recipient in [1003980922525, 1511697499654459422, 1812605657]:
print(f"Notification to {recipient}: DynDNS updated: {channel}")
await discord.Embed(status=f"No Change")
await channel.send(embed=dis)
# Create the bot and run it
bot = DnnBot()
bot = await get_github_bot()
await bot.change_presence(activity=discordActivitiesstatus())
`
In your Python script, make sure to initialize Discord Webhook and the other notifications in DnnBot
before running the main code.
Note: The run` command provided must be executed locally for this feature to work.