Code Monkey home page Code Monkey logo

ovh-ddns's Introduction

OVH DDNS

A linux service to periodically check for public IP address changes. Updates OVH DNS record using Python and the OVH API. Pretty much a dynamic DNS solution.

Requirements

  • Linux
    • Python 2.x or Python 3.x with binary in /usr/bin/
    • Pip or Pip3 with binary in /usr/bin/
    • Sudo privileges
  • OVH API Credentials

Installation

## Clone the git repository and move into it
git clone https://github.com/HariboDev/ovh-ddns.git
cd ovh-ddns

## Change the permissions on the setup script to allow for execution
sudo chmod +x ./setup.sh

## Execute the script
## You must be sudo or root
sudo ./setup.sh

The setup.sh script:

  • Checks if currently running as sudo or root
  • Attempts to locate the Python binaries for Python2.x or Python3.x
  • Prefers Python3.x if possible
  • Installs dependencies
  • Changes the file permissions
  • Asks for the following:
    • DNS zone name
    • DNS record ID
    • Subdomain to be updated
    • Record target
    • DNS record TTL (must be int && > 0)
    • Service interval time (must be int && > 0)
  • Retrieves the current IP address of the server
  • Populates the ovh-ddns.json data file
  • Moves the service, Python script and data files to relevent directories
  • Reloads the system manager configuration using systemctl daemon-reload
  • Asks if you want to load the service on server boot:
    • If so, enables the service using systemctl enable ovh-ddns.service
  • Starts the service using systemctl start ovh-ddns.service

Usage

When the service is running, the Python interpreter is used to:

  • Check for a change in the server's public IP
  • Attempts to update the OVH DNS record
  • Updates ovh-dns.json data file to hold the new public IP address

To view the logs to check for success or failures, execute the following command:

sudo journalctl -xe -u ovh-ddns.service -f

Uninstallation

## Move into the directory of the repository
cd ovh-ddns

## Change the permissions on the script to allow for execution
sudo chmod +x ./uninstall.sh

## Execute the script
## You must be sudo or root
sudo ./uninstall.sh

The uninstall.sh:

  • Disables the service
  • Stops the service
  • Deletes the service files
  • Deletes the Python script and data files

ovh-ddns's People

Contributors

haribodev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hadrienlg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.