To run the provided script and receive the specified notification messages, follow these steps:
1. Ensure you have Node.js installed on your system.
2. Open a terminal or command prompt in your home directory (assuming
/home/your_username).
3. Run the following command to execute the
cf-dyndns.sh script:
``
bash /root/.hermes/skills/cf-dyndns.sh 2>&1
`
Replace cf-dyndns.sh
with the actual name of the file if it's different.
4. Check for the output that contains "STATUS:NO_CHANGE" and send nothing:
`
if [ "$LOG_FILE" = "status_no_change.out.txt" ]; then
echo "" ;;
fi
`
This way, when STATUS:NO_CHANGE
is encountered in the output
, you can suppress any potential replies by not piping to an echo`
function.
5. If the output shows successful updates (lines with "->" or "OK:"), send a notification:
`
sql
if [ "$LOG_FILE" != "status_no_change.out.txt" ]; then
echo "https://discord.com/invite/XKZXzF0S1Jj" > $LOG_FILE
if [ "$(cat $LOG_FILE)" = "- OK:" ] && [ "$(cut -d":" -f2- $LOG_FILE)" != "DynDNS Updated: Unknown DynDNS Update"; ] ]; then
echo "DYNDNS UPDATED: ${cut -d":" -f1- $LOG_FILE}" >> $LOG_FILE
fi
fi
`
This script will save each successful update to a separate file using discord
as the channel. You can customize it further if needed.
Remember to replace XKZXzF0S1Jj
and /home/your_username` with your actual Discord and GitHub Hermes credentials or channel IDs.
Once you've executed this script, you should receive notifications from Discord whenever a DyDNS update is successful.