diff --git a/README.md b/README.md index 6bafc13..4fcde01 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,66 @@ # Cloudflare Dynamic DNS IP Updater -GitHub GitHub last commit (branch) GitHub contributors This script is used to update Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP! Written in pure BASH. -## Support Me -[![Donate Via Paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/Jasonkkf) +This version of this script allows you to update multiple domains/sub domains with the same public IP for IPv4, IPv6 version remains per single domain. -## Installation +## Clone ```bash -git clone https://github.com/K0p1-Git/cloudflare-ddns-updater.git +git clone https://github.com/joeltgray/cloudflare-ddns-updater.git ``` ## Usage -This script is used with crontab. Specify the frequency of execution through crontab. +This version of the script is used with systemd. Update the paths in config below to match your setup. +If you need to know how to use systemd services check out my blog here: + [Running A Service on Systemd](https://graycode.ie/blog/run-anything-as-a-service-on-linux/) -```bash -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12) -# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday 7 is also Sunday on some systems) -# │ │ │ │ │ ┌───────────── command to issue -# │ │ │ │ │ │ -# │ │ │ │ │ │ -# * * * * * /bin/bash {Location of the script} +### Make the service file +`nano /etc/systemd/system/cloudflare-ddns-updater.service` +``` +[Unit] +Description=Service to update Cloudflare servers with this servers public IP + +[Service] +ExecStart=/bin/bash /path/to/your/cloudflare-ddns-updater/cloudflare-updater.sh +Restart= +EnvironmentFile=/etc/environment + +[Install] +WantedBy=multi-user.target +``` + +### Make the service timer file +`nano /etc/systemd/system/cloudflare-ddns-updater.timer` +``` +[Unit] +Description=Run the script for Cloudflare SDNS updates every 5 minutes + +[Timer] +OnCalendar=*-*-* *:00/5:05 +OnBootSec=5 +Persistent=true + +[Install] +WantedBy=timers.target ``` ## Tested Environments: +Original: macOS Mojave version 10.14.6 (x86_64)
AlmaLinux 9.3 (Linux kernel: 5.14.0 | x86_64)
Debian Bullseye 11 (Linux kernel: 6.1.28 | aarch64)
+This version: +Debian 11 (Linux kernel: 6.1.0-0.deb11.13-amd64 | x86_64)
+Arch rolling (Linux kernel: 6.7.4-arch1-1 | x86_64)
+ + ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. ## Reference -This script was made with reference from [Keld Norman](https://www.youtube.com/watch?v=vSIBkH7sxos) video. +This script was originally made by [Keld Norman](https://www.youtube.com/watch?v=vSIBkH7sxos) video, I've adapted from [Jason K](https://github.com/K0p1-Git)'s version ## License [MIT](https://github.com/K0p1-Git/cloudflare-ddns-updater/blob/main/LICENSE) diff --git a/cloudflare-templatev6.sh b/cloudflare-dns-updater-v6.sh similarity index 100% rename from cloudflare-templatev6.sh rename to cloudflare-dns-updater-v6.sh diff --git a/cloudflare-template.sh b/cloudflare-dns-updater.sh similarity index 100% rename from cloudflare-template.sh rename to cloudflare-dns-updater.sh