/Cloudflare-DDNS-bash-script

Dynamic DNS update script for Cloudflare. Using API v4. Ease to use. Clear instructions.

Primary LanguageShellApache License 2.0Apache-2.0

Contributors Forks Stargazers Issues MIT License


Logo

Cloudflare DDNS bash script

Cloudflare DDNS bash script is an simple script written in bash for updating IP address in Cloudflare DNS services.

Report Bug ยท Request Feature

Table of Contents ๐Ÿ“ƒ

  1. About The Project โšก
  2. Getting Started ๐Ÿ“”
  3. Usage ๐Ÿ‘€
  4. Contributing โค๏ธ
  5. License ๐Ÿ“„
  6. Contact ๐Ÿ“ž

About The Project โšก

This is my first hobbiest project which can help someone else in every day life.

Built With

Getting Started ๐Ÿ“”

To get a local copy up and running follow these simple steps.

Prerequisites

  • Bash
  • Git
    • Install on RPM-based Linux distros:
    • sudo dnf install git-all
    • Install on Debian-based Linux distros:
    • sudo apt install git-all

Installation

  1. Use your command line and clone the repository:
git clone https://github.com/Zacer559/Cloudflare-DDNS-bash-script
  1. Go to folder which you cloned:
cd Cloudflare-DDNS-bash-script
  1. Change all declaration parameters(line 4 to 9) in file to your for example using nano:
nano Cloudflare.sh

alt text

So in case of that picture your config should look similar to this:

# Declarations of names and ids of records.
declare -a RECORD_NAMES=("zacer.pl" "mail.zacer.pl" "vpn.zacer.pl" "dysk.zacer.pl")
AUTH_EMAIL="example@example.com"
AUTH_KEY="8M7wS6hCpXVc-DoRnPPY_UCWPgy8aea4Wy6kCe5T"
ZONE_NAME="zacer.pl"
IP_FILE="/tmp/CloudFlare_IP" 
PROXIED=true

Here is the guide how to get authorization key.

Usage ๐Ÿ‘€

One time run:

  • bash Cloudflare.sh

Cyclic activation (using crontab):

  • Go to crontab editing:
    • crontab - e
  • Add crontab entry like this (Example - run script every 10 minutes):
    • */10 * * * * /path/to/script >> /dev/null
    • To get more timing options check out crontab guru

Contributing โค๏ธ

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

License ๐Ÿ“„

Copyright 2020 Zacer559

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contact ๐Ÿ“ž

@Super_Widower - zacer559@gmail.com

Project Link: https://github.com/Zacer559/Cloudflare-DDNS-bash-script