Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
filiparag committed Dec 7, 2024
1 parent 3a34c14 commit 14cee19
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 20 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Hetzner Dynamic DNS Daemon

A simple daemon to continuously update Hetzner DNS
*A* and *AAAA* records for your server with a dynamic IP address.
_A_ and _AAAA_ records for your server with a dynamic IP address.

It features support for multiple subdomain records with painless
configuration and administration.
Expand Down Expand Up @@ -70,6 +70,12 @@ domain='example.com'

# Space separated host subdomains (@ for domain itself)
records='homelab media vpn'

# Enable updating A records (IPv4)
ipv4=true

# Enable updating AAAA records (IPv6)
ipv6=true
```

To obtain an **API key**, go to [Hetzner DNS Console](https://dns.hetzner.com/settings/api-token).
Expand Down Expand Up @@ -116,6 +122,7 @@ sudo systemctl enable hetzner_ddns@foobar
## Usage

**Run on startup**

```ini
# systemd
sudo systemctl enable hetzner_ddns
Expand All @@ -128,6 +135,7 @@ sudo rc-update add hetzner_ddns
```

**Start/Stop**

```ini
# systemd
sudo systemctl start/stop hetzner_ddns
Expand Down
12 changes: 11 additions & 1 deletion hetzner_ddns.1.man
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" Manual for hetzner_ddns.
.TH "hetzner_ddns" 1 "2 August 2024" "hetzner_ddns 0.2.5" "Hetzner DDNS Manual"
.TH "hetzner_ddns" 1 "8 December 2024" "hetzner_ddns 0.2.6" "Hetzner DDNS Manual"
.SH NAME
.B hetzner_ddns
\- Hetzner Dynamic DNS Daemon
Expand Down Expand Up @@ -66,3 +66,13 @@ Top level domain name
Space separated host subdomains (
.B @
for the domain itself )
.HP
.B ipv4
<true|false>
.br
Enable updating A records (IPv4)
.HP
.B ipv6
<true|false>
.br
Enable updating AAAA records (IPv6)
54 changes: 36 additions & 18 deletions hetzner_ddns.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

self='hetzner_ddns'
version='0.2.5'
version='0.2.6'
daemon=0

for arg in $(seq "$#"); do
Expand All @@ -13,24 +13,42 @@ for arg in $(seq "$#"); do
printf '%s %s\n' "$self" "$version"
exit 0;;
'--help'|'-h')
# man usually not available on OpenWrt (too big)
# use short help string in that case
if ! command -v man > /dev/null; then
echo "${self} ${version} - Hetzner Dynamic DNS Daemon
Usage hetzner_ddns.sh [--daemon] [CONFIG]
This program runs as system service /etc/init.d/hetzner_ddns on OpenWrt.
-h, --help Print help and exit
-v, --version Print version and exit
-d, --daemon Detach from current shell and run as a deamon
Configuration file is located at /usr/local/etc/hetzner_ddns.conf
interval='60' # Seconds between updates / TTL value
key='********************************' # Hetzner DNS API key
domain='example.com' # Top level domain name
records='homelab media vpn' # Space separated host subdomains (@ for domain itself)
Control service with: service hetzner_ddns status|start|stop|restart after specifying the config"
else
man hetzner_ddns;
fi
Usage:
Run on startup
service hetzner_ddns enable
Start
service hetzner_ddns start
Stop
service hetzner_ddns stop
Runtime messages log file
Runtime log is located at /var/log/hetzner_ddns.log
Multiple daemon instances (systemd only)
systemctl <action> hetzner_ddns@CONFIG
Options:
-d, --daemon Detach from current shell and run as a deamon
-h, --help Print help and exit
-v, --version Print version and exit
Configuration: /usr/local/etc/hetzner_ddns.conf
interval <seconds> Seconds between updates
key <32 character key> Hetzner DNS API key
domain <domain name> Top level domain name
records <hostname>... Space separated host subdomains
ipv4 <true|false> Enable updating A records
ipv6 <true|false> Enable updating AAAA records
"
exit 0;;
*)
self="${self}.$param";;
Expand Down

0 comments on commit 14cee19

Please sign in to comment.