131 lines
4.2 KiB
Markdown
131 lines
4.2 KiB
Markdown
# NAME
|
|
|
|
petrified - bash client to update dynamic DNS at freedns.afraid.org
|
|
|
|
# SYNOPSIS
|
|
|
|
Usage: **petrified** [ **-c** *config* ]
|
|
|
|
# DESCRIPTION
|
|
|
|
Petrified is a bash client to update dynamic DNS hosted at
|
|
https://freedns.afraid.org; the software goals are for simplicity,
|
|
flexibility and configurability while using the minimal system tools
|
|
installed with most distributions.
|
|
|
|
If upgrading from API v1 to v2, a manual action is required on the
|
|
FreeDNS website to generate a new API key for each domain name. See
|
|
https://freedns.afraid.org/dynamic/v2/ for more information.
|
|
|
|
By default, petrified will use the length of the API key to automatically
|
|
choose the APIv1 or APIv2 URL; this can be overridden in the configuration
|
|
file to force a specific version, as the v1 key length is variable but the
|
|
v2 key length is fixed at 24 chars.
|
|
|
|
# OPTIONS
|
|
|
|
**-c** *config*
|
|
|
|
: Specify an exact config file to use, ignoring global and per-user configs.
|
|
|
|
# CONFIGURATION
|
|
|
|
See *petrified.conf* for all available options and their usage.
|
|
|
|
Copy the default configuration file to */etc/petrified.conf* for global
|
|
use, *~/.petrifiedrc* for user-level use, or another location as desired.
|
|
At a minimum the "DDNS\_KEY" variable must be configured for basic usage;
|
|
all other variables are preconfigured for system level (root) usage.
|
|
|
|
If implementing at the user level, be sure and set the various file options
|
|
to locations that are writable by the user; the default config is fully
|
|
documented and should make sense.
|
|
|
|
To use a custom configuration file, the "-c config" parameter is supported;
|
|
note that using this option will not read the global or local configuration
|
|
files and only use the variables from this custom file.
|
|
|
|
# SYSTEMD
|
|
|
|
The provided systemd unit files are designed to use the native systemd timer
|
|
functionality in place of a cron daemon. The timer can be activated as the
|
|
system user which will use specifically the global */etc/petrified.conf*
|
|
configuration, or as any given user which will use the *~/.petrifiedrc*
|
|
configuration.
|
|
|
|
system: systemctl --now enable petrified.timer
|
|
systemctl list-timers petrified.timer
|
|
|
|
user: systemctl --user --now enable petrified.timer
|
|
systemctl --user list-timers petrified.timer
|
|
|
|
Multiple interfaces can be configured using the standard systemd semantics
|
|
of unit overrides, which might look like this:
|
|
|
|
/etc/systemd/system/petrified-iface1.service
|
|
--------------------------------------------
|
|
.include /usr/lib/systemd/system/petrified.service
|
|
[Service]
|
|
ExecStart=
|
|
ExecStart=/usr/bin/petrified -c /etc/petrified-iface1.conf
|
|
|
|
The first "ExecStart" is intentional, needed to negate the existing value
|
|
first before defining a new value (systemd design for ExecStart override).
|
|
|
|
A corresponding new timer is then created to call this unit as it may be
|
|
desireable to run different interfaces on different time schedules, which
|
|
might then look like this:
|
|
|
|
/etc/systemd/system/petrified-iface1.timer
|
|
--------------------------------------------
|
|
.include /usr/lib/systemd/system/petrified.timer
|
|
[Timer]
|
|
Unit=petrified-iface1.service
|
|
OnCalendar=0/8:00:00
|
|
|
|
This timer will now operate the new custom unit when it's enabled.
|
|
|
|
**See also:**
|
|
|
|
+ http://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
|
+ http://www.freedesktop.org/software/systemd/man/systemd.timer.html
|
|
|
|
# DEPENDENCIES
|
|
|
|
Utilities | Package
|
|
-----------------------------------|------------
|
|
logger, kill | util-linux
|
|
printf, touch, date, stat, cat, rm | coreutils
|
|
bash | bash
|
|
ip | iproute2
|
|
curl | curl
|
|
|
|
# FILES
|
|
|
|
**/etc/petrified.conf**
|
|
|
|
: Global configuration file
|
|
|
|
**~/.petrifiedrc**
|
|
|
|
: Per-user configuration file
|
|
|
|
**/var/cache/petrified/lastip.dat**
|
|
|
|
: IP cache (if feature enabled - default: yes)
|
|
|
|
**/run/petrified.pid**
|
|
|
|
: PID file (if feature enabled - default: no)
|
|
|
|
**/var/log/petrified.log**
|
|
|
|
: LOG file (if feature enabled - default: no)
|
|
|
|
# AUTHOR
|
|
|
|
Copyright (c) 2014 Troy Engel
|
|
|
|
Licensed under the GNU General Public License version 3 or later,
|
|
see https://gnu.org/licenses/gpl.html
|
|
|