A shell script for CloudXNS DDNS
- API_KEY is required:
e.g.
API_KEY="af0b62d0e4b5898587dde0ea6fddd97e"
- SECRET_KEY is required:
e.g.
SECRET_KEY="28c9ca6aa33241e6"
- DOMAIN is required:
e.g.
DOMAIN="example.com"
orDOMAIN="www.example.com"
- IP is optional: Leave it blank let server autodetect yourt public IP
e.g.
IP=""
: Autodetect public IP. [Recommend].IP="1.2.3.4"
: Single IPIP="1.2.3.4|2.2.3.4"
: Several IPs separated by "|"
- If there's everything OK, it prints
<date> -- success
and returns with 0.e.g.
Tue, 30 Aug 2016 19:41:56 +0800 -- Success
- Otherwise it prints
<date> -- failed:<message>
and returns with 255.e.g.
Tue, 30 Aug 2016 19:41:36 +0800 -- Failed:{"code":639,"message":"The host record does not exist"}
Assume you are a normal user names someone and you put the edited cloudxns-ddns.sh in
/home/someone
.You run
$crontab -e
and add a line like this:
* * * * * /home/someone/cloudxns-ddns.sh >> /home/someone/cloudxns-ddns.log
- It means
cloudxns-ddns.sh
will run at every minute, and log result to/home/someone/cloudxns-ddns.log
.
- CloudXNS Support
- CloudXNS API Version: 2.0.0