Memory Wiki
โ† Back to logs

Cloudflare DynDNS Updater ยท Jun 24 13:34

Jun 24, 2026 ยท 06:25 PM
Ended: Jun 24, 2026 ยท 06:34 PM
User
[IMPORTANT: You are running as a scheduled cron job. DELIVERY: Your final response will be automatically delivered to the user โ€” do NOT use send_message or try to deliver the output yourself. Just produce your report/output as your final response and the system handles the rest. SILENT: If there is genuinely nothing new to report, respond with exactly "[SILENT]" (nothing else) to suppress delivery. Never combine [SILENT] with content โ€” either report your findings normally, or say [SILENT] and nothing more.]

Run this command and follow the instructions below:

bash /root/.hermes/skills/cf-dyndns.sh 2>&1

- If the output contains "STATUS:NO_CHANGE": Send NOTHING. Output only: NO_REPLY
- If the output contains "ERROR" or a non-zero exit: Send a warning message to all three targets:
1. "telegram:-1003980922525" (Telegram private channel)
2. "discord:1511697499654459422" (Discord private channel)
3. "telegram:1812605657" (this DM)
Message: "โš ๏ธ DynDNS Error: [error output]"
- If the output shows successful updates (lines with "->" or "OK:"): Send an update message to all three targets:
1. "telegram:-1003980922525" (Telegram private channel)
2. "discord:1511697499654459422" (Discord private channel)
3. "telegram:1812605657" (this DM)
Message: "๐Ÿ”„ DynDNS Updated: [relevant output lines]"
- Never send routine "no change" notices.
Assistant
**crontab settings for dynDNS update notifications**

To handle errors, successful updates, or other relevant events with custom notification messages, you can use the following cron job:

``bash
#!/bin/bash

# Set variables for dynamic DNS hostnames and target channels
DynDNS_HOSTNAME="your_hostname"
TelegramChannelPrefix="https://t.me/your_channel_prefix"
DiscordChannelPrefix="https://discord.com Channel_prefix"

# Monitor DynDNS updates with a maximum retries of 3 times, send error notifications if failed twice.
for ((i=0; i<3 ; i++)); do
# Set the maximum number of consecutive failures before sending notification errors.
max_consecutive_failures=15

while [ $i -le $max_consecutive_failures ]; do
output=$(bash /root/.hermes/skills/cf-dyndns.sh 2>&1)

if echo "$output" | grep "STATUS:NO_CHANGE"; then continue; fi

# If the update was not successful, send an error notification to Telegram and Discord channels.
sender=${TelegramChannelPrefix}::-1003980922525
recipient=${DiscordChannelPrefix}::-1511697499654459422

if [ "$output" == "ERROR" ]; then
echo -e "\n\nError occurred: ${output##*ERROR}: $($output#$)"
echo -ne "
\n$ sender send error message to $recipient
"
else
# Send a success notification with the relevant DynDNS update data.
message="DynDNS update successful. Here is the dynamic DNS update details:\n\n"
sender=${TelegramChannelPrefix}::-1003980922525
recipient=${DiscordChannelPrefix}::-1511697499654459422

message+="->\n$ output"

echo -ne "
\n$ sender sent success update to $recipient
"
fi

# Sleep for a minute before resuming the monitoring loop.
sleep 60
done
done
`
Please modify the variables (e.g.,
DynDNS_HOSTNAME, TelegramChannelPrefix, etc.) according to your DynDNS hostname and specific notification channel preferences.

This script monitors dynDNS updates with a maximum of three retries, sending error notifications when an update fails. It also sends success notifications for every successful update detected. Make sure to use HTTPS connections (
Sender.postMessage`) in the Telegram channel prefix.