A simple (cron) script to update DynHost on OVH hosting
This script works with two linux commands : curl and dig. If you do not have the dig you must install it from the package "dnsutils" :
sudo apt-get update
sudo apt-get install curl dnsutils
- Download the dynhost.sh script and put it in the folder /etc/cron.hourly (to check every hour)
- Add execution permissions to file : chmod +x dynhost.sh
- Modify the script with variables : HOST, LOGIN, PASSWORD
- HOST='YOUR_DOMAINE_NAME'
- LOGIN='YOUR_LOGIN'
- PASSWORD='YOUR_PASSWORD'
- The command dig is used to retrieve the IP address of your domain name.
- The command curl (with the website ifconfig.me/ip) is used to retrieve the current public IP address of your machine.
- The two IPs are compared and if necessary a curl command to OVH is used to update your DynHost with your current public IP address.
project forked and modified from https://github.com/yjajkiew/dynhost-ovh (Yann Jajkiewicz)