You can access the dynDNS settings by running the following command in your home directory:
``
bash /root/.hermes/skills/cf-dyndns.sh
`
However, this may not directly provide you with the dynDNS API code or keys. To find and obtain these keys, follow these steps:
1. Open a web browser and navigate to ." target="_blank" rel="noopener">https://your-username.com/. Replace
your-username with your Amazon Web Services (AWS) ID.
2. In the top right corner of the page, you'll see an icon that looks like a user. Click on this icon.
3. On the pop-up menu that appears, click on "View Credentials".
4. Scroll down to the Dynamo DNS settings section and note down your DynaDNS API key.
Now, let's execute your cron job using the obtained DynaDNS keys:
1. Copy the entire text within the red box in
/etc/ crontab, which is usually found on a single line.
2. Save this command to a new file (e.g.,
update_dynadns.sh).
3. Replace the contents of the script inside with the following:
``
bash
#!/bin/bash
keys="YOUR DYNADNS API KEY 1 your-aws-identifier";
if [[ $(id -u) == $UID && $(type -t "$(bash -c 'echo | grep ^aws-')" | awk '{print $NF} ) == 0 ]]; then
echo "STATUS:NO_CHANGE" >> "$keys"
fi
if [ "$(echo "$2" | rev; dogma grep '^^\|'" | cut -d'->' -f3)" = "UPDATE" ]; then
echo "OK:" >> "$keys"
curl https://api.dynadns.com/api.json?key=$keys&action=dynsphupdate&domain=tld.verizon.com --silent > response.txt
curl https://api.dynadns.com/api.json?key=$keys&action=dynsphupdate&domain=google.com --silent >> response.txt
fi
if [ "$(echo "$2" | rev; dogma grep '^^\|'" | cut -d'->' -f3)" = "OK" ]; then
echo "OK:" > "$keys"
curl https://api.dynadns.com/api.json?key=$keys&action=dynsphupdate &domain=relnet.l.google.co.uk --silent > response.txt
curl https://api.dynadns.com/api.json?key=$keys&action=dynsphdelete&domain=relnet.l.google.co.uk --silent >> response.txt
fi
if [[ $(type -t "$(bash -c 'echo | grep ^aws-)" | awk '{print $NF} ) !="0" ]]; then
echo "no change" >> "$keys"
fi
cat < response.txt
`
4. Save the script inside of a .sh
file (in this case, update_dynadns.sh
) with no special characters (-
is already handled by bash as an escape character).
5. Give execute permissions to the script:
`
bash
chmod +x update_dynadns.sh
`
6. Run the cron job:
`
cron job:
`
If you want DynaDNS errors reported, simply tell telegram that you got one of those error messages:
Telegram: -1003980922525 /root/cron/dynamicsnerrors`
Alternatively, you can specify different channels for sending and receiving such message.