Cleaned up markdown coding

This commit is contained in:
Asif Bacchus 2018-09-27 17:42:43 -06:00
parent 74fab6429a
commit d9d9e58764

View File

@ -43,9 +43,10 @@ #### Installation:
``` ```
#### Usage: #### Usage:
If you run the script with no parameters, it will display the help screen. The If you run the script with no parameters, it will display the help screen. The
script accepts several parameters with 2 being required. The parameters are script accepts several parameters with 2 being required. The parameters are
summarized here. You can access the help screen and example usage screens by summarized here. You can access the help screen and example usage screens by
running: running:
```Bash ```Bash
@ -54,17 +55,17 @@ #### Usage:
``` ```
**-f: full path and filename containing account details (REQUIRED)** **-f: full path and filename containing account details (REQUIRED)**
This is the full path to a plain-text file containing your CloudFlare account This is the full path to a plain-text file containing your CloudFlare account
details. This file must contain 3 lines in the following order: details. This file must contain 3 lines in the following order:
* authorized email address - authorized email address
This is an email address that is permitted to login to your CloudFlare account. This is an email address that is permitted to login to your CloudFlare account.
* global api-key - global api-key
You can get your Global API-key by going to your CloudFlare dashboard, You can get your Global API-key by going to your CloudFlare dashboard,
clicking on your profile picture in the upper-right and opening your profile. clicking on your profile picture in the upper-right and opening your profile.
Scroll down to to the API Keys section. Click on the 'View' button next to Scroll down to to the API Keys section. Click on the 'View' button next to
Global API Key. Global API Key.
* zone identifier - zone identifier
You should be able to find this on the Overview page of your CloudFlare dashboard. You should be able to find this on the Overview page of your CloudFlare dashboard.
Your completed file should look like (these are not real credentials): Your completed file should look like (these are not real credentials):
@ -142,8 +143,9 @@ #### Usage:
provided provided
## cfddns.service ## cfddns.service
This file **must** be copied to your */etc/systemd/system* directory (or This file **must** be copied to your */etc/systemd/system* directory (or
equivalent directory if you're not running debian/ubuntu). If you change the equivalent directory if you're not running debian/ubuntu). If you change the
name of the cfddns.sh file, you must update the filename in the *ExecStart* name of the cfddns.sh file, you must update the filename in the *ExecStart*
line as shown below: line as shown below:
@ -156,6 +158,7 @@ ## cfddns.service
```` ````
#### IP4 and/or IP6 #### IP4 and/or IP6
The cfddns.service file includes two *ExecStart* lines, one without a specified The cfddns.service file includes two *ExecStart* lines, one without a specified
IP-protocol parameter (default IP4) and the other with the -6 (IP6) parameter. IP-protocol parameter (default IP4) and the other with the -6 (IP6) parameter.
The service will run the cfddns.sh script in default (IP4) mode with specified The service will run the cfddns.sh script in default (IP4) mode with specified
@ -165,6 +168,7 @@ #### IP4 and/or IP6
*Note: The parameters *can be different* in each case.* *Note: The parameters *can be different* in each case.*
#### Examples #### Examples
1. **Only update A records** 1. **Only update A records**
Update *mail<span>.example.com* A record with the current IP of this machine and log Update *mail<span>.example.com* A record with the current IP of this machine and log
results to */var/log/cfddns.log*. results to */var/log/cfddns.log*.
@ -203,6 +207,7 @@ #### Examples
``` ```
## cfddns.timer ## cfddns.timer
This is the timer file that tells your system how often to call the This is the timer file that tells your system how often to call the
cfddns.service file which runs the cfddns&#46;sh script. By default, the timer is cfddns.service file which runs the cfddns&#46;sh script. By default, the timer is
set for 5 minutes after the system boots up (to allow for other processes to set for 5 minutes after the system boots up (to allow for other processes to
@ -227,6 +232,7 @@ ## cfddns.timer
minutes) after everything is working. minutes) after everything is working.
#### Activation #### Activation
You can start the timer system immediately via systemctl You can start the timer system immediately via systemctl
```Bash ```Bash
@ -249,6 +255,7 @@ #### Activation
to be active. to be active.
## The log file ## The log file
The script logs every major action it takes and provides details on any errors The script logs every major action it takes and provides details on any errors
it encounters in the log file (see the above section for details on log file it encounters in the log file (see the above section for details on log file
location and name). If errors are encountered, they are colour coded red and location and name). If errors are encountered, they are colour coded red and
@ -260,20 +267,21 @@ ## The log file
following conventions are observed in the log file and can be used to program following conventions are observed in the log file and can be used to program
your log-watch system: your log-watch system:
* Errors always appear as **-- [ERROR] text and error code here --** - Errors always appear as **-- [ERROR] text and error code here --**
* Errors are followed by an explanation of the specific error code on a new line - Errors are followed by an explanation of the specific error code on a new line
* A clean exit appears as **-- [SUCCESS] some text here --** - A clean exit appears as **-- [SUCCESS] some text here --**
* The script always starts a new set of log entries with **-- Start CloudFlare - The script always starts a new set of log entries with **-- Start CloudFlare
DDNS script execution --** DDNS script execution --**
* All log file entries start with a time-stamp in **[square brackets]** - All log file entries start with a time-stamp in **[square brackets]**
If you are using the Logwatch package to monitor your system, see the README in If you are using the Logwatch package to monitor your system, see the README in
the /etc/logwatch folder for details about the pre-configured service files the /etc/logwatch folder for details about the pre-configured service files
already done for you :-) already done for you :-)
## Final thoughts ## Final thoughts
I'm by no means an expert in BASH scripting and I only program/script as a hobby I'm by no means an expert in BASH scripting and I only program/script as a hobby
when I find stuff that irritates me and no other good solutions seem easily when I find stuff that irritates me and no other good solutions seem easily
available. So, by all means, please comment, provide feedback and suggestions available. So, by all means, please comment, provide feedback and suggestions
to make this script better! Thanks, I hope this helps someone else out! to make this script better! Thanks, I hope this helps someone else out!