lennshow66
New Around Here
Hi Guys,
Im after some help in regards to how to set up a custom script for DDNS.
I have my ADSL modem which connects to my asus rt-ac68u router. I want to set my router up to update my domain name from namecheap so can access my IP camera outside the network.
I have figured out that I need to create a custom script as the WAN ip of my router is 192.168.1.100 (the modem).
I am having trouble writing this custom script as I have never done anything like this before.
I need to grab my external ip address and then update it to my domain. I need advice how I willl be able to do this. I have attached my code below.
Another problem im having is uploading the code to the router? How do I do this, im in the 'jffs/scripts/' folder on the router but cant figure out how to save my code to the router?
Thanks for any help you can give
Im after some help in regards to how to set up a custom script for DDNS.
I have my ADSL modem which connects to my asus rt-ac68u router. I want to set my router up to update my domain name from namecheap so can access my IP camera outside the network.
I have figured out that I need to create a custom script as the WAN ip of my router is 192.168.1.100 (the modem).
I am having trouble writing this custom script as I have never done anything like this before.
I need to grab my external ip address and then update it to my domain. I need advice how I willl be able to do this. I have attached my code below.
Another problem im having is uploading the code to the router? How do I do this, im in the 'jffs/scripts/' folder on the router but cant figure out how to save my code to the router?
Thanks for any help you can give
Code:
#!/bin/sh
# Update the following variables:
HOSTNAME=@
DOMAIN=mydomain.com
PASSWORD=************************
IP=$(wget -qO - http://icanhazip.com)
# Should be no need to modify anything beyond this point
/usr/sbin/wget --no-check-certificate -qO - "https://dynamicdns.park-your-domain.com/update?host=$HOSTNAME&domain=$DOMAIN&password=$PASSWORD&ip="
if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi