From 3bdf45f015965a9f9f96da451b2a8a7f7455e04e Mon Sep 17 00:00:00 2001 From: LordOf20th Date: Mon, 14 Mar 2022 21:33:44 +0100 Subject: [PATCH] Update README.md Rewrote the README to match the usage with the new class implemented --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c0debb7..114ae2b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,22 @@ and replacing the IP with the public IP of the machine on which the code is exec This script was inspired by matt1's gandi-ddns script : [matt1/gandi-ddns](https://github.com/matt1/gandi-ddns) ## Usage -The script was designed to be run using a cron task : +1. **Define an object of class GanDynDns at the end of the file** : +``` +main = GanDynDns("example.org", "@", "A", "your-api-key") +``` +Or if you want to define multiple domains to update : + +``` +domain = "example.org" +apikey = "your-api-key" + +main = GanDynDns(domain, "@", "A", apikey) +mail = GanDynDns(domain, "mail", "A" apikey) +``` +Each time the script runs and the objects are created they check if *the IPs in the DNS record* match the *current public IP*. + +2. **Run the script using a cron task** : ``` sudo crontab -e