Dnspod ddns in Python3
DDns script for dnspod.cn and written in Python3
Write for router(Openwrt/LEDE), but it could be used in any Linux machine
opkg update
opkg install python3
https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install requests
ddns.py
file
ID = "" # your ID
TOKEN = "" # Your Token
DOMAIN_NAME = "" # your domain
SUB_DOMAIN = "" # your sub domain
/etc/ppp/ip-up.d
,and add python3 /root/script/ddns.py > /tmp/log/dnspod.log
to file.chmod 777 /etc/ppp/ip-up.d/<your_script_name>
Dnspod.cn declare a limitation that every user can only upload 5 times in an hour if remote IP address and local IP address is same.
They also sugget that build a script when you create a new dial-up connection, run the script to update your IP address.
So it is in /etc/ppp/ip-up.d
folder, that every time you use pppoe
to connect to the Internet and you will receive a new IP address. Then every time pppoe
runs, the OS will run every script in /etc/ppp/ip-up.d
folder.
WFTDPL
You just DO WHAT THE FUCK YOU WANT TO.