Skip to content

dcorral3/server_ip_utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IP CHECK AND NAMECHEAP DDNS UPDATE

This script checks whether current ip is the same as the previous one, if not, calls namecheap API and updates IP on your listed hosts with the IP of the calling machine.

Dependencies

Installing

Clone project:

git clone https://github.com/dcorral3/server_ip_utils.git

Set environment variables:

export DNS_DOMAIN_NAME=<example.com>
export DNS_PASSWORD=<password> # !! Sensitive information
export DNS_UPDATE_INTERVAL=<number | Default=15> # minutes to repeat script execution.
Tutorial for finding DNS_PASSWORD here

Deployment

  1. Go to the downloaded folder:
cd server_ip_utils
  1. Execute script
./check_ip

Done!

The script will generate logs and last_ip files.

  • logs file will store the response of the curl command.

  • last_ip file will store the last IP for comparison.

Note: that you might also execute this as a cronjob using crontab.

More about crontab.

Contributing

Do not be afraid of submitting pull requests to me. Happy to learn from you all =D.

Authors

  • Diego del Corral - Initial work - dcorral3

License

What?