/cloudxns-ddns

A shell script for CloudXNS DDNS

Primary LanguageShellMIT LicenseMIT

cloudxns-ddns

A shell script for CloudXNS DDNS

Requirements: *nix shell with curl

Usage:

1. Edit blank sections as you need.

e.g. API_KEY="af0b62d0e4b5898587dde0ea6fddd97e"

e.g. SECRET_KEY="28c9ca6aa33241e6"

  • DOMAIN is required:

e.g. DOMAIN="example.com" or DOMAIN="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 IP
  • IP="1.2.3.4|2.2.3.4" : Several IPs separated by "|"

2. Run it.

  • 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"}

Example:

  • 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.

Thanks to:

Refers: