summaryrefslogtreecommitdiff
path: root/systemd
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-12-08 18:42:54 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-12-08 18:42:54 -0800
commit7d5817dfcd5f93e56f770353059ba845314f9646 (patch)
treea270440c61531e6560af7f480f798ae8324313d6 /systemd
parent27c3a59dc75c2bf4ec90b2ef752939124618dffa (diff)
downloadlinode-ddns-7d5817dfcd5f93e56f770353059ba845314f9646.tar.gz
linode-ddns-7d5817dfcd5f93e56f770353059ba845314f9646.tar.xz
add systemd service and timer
Diffstat (limited to 'systemd')
-rw-r--r--systemd/linode-ddns@.service6
-rw-r--r--systemd/linode-ddns@.timer9
-rw-r--r--systemd/linode-ddns@home.example.org.service.d/opts.conf4
3 files changed, 19 insertions, 0 deletions
diff --git a/systemd/linode-ddns@.service b/systemd/linode-ddns@.service
new file mode 100644
index 0000000..35905b4
--- /dev/null
+++ b/systemd/linode-ddns@.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Linode DDNS updater
+
+[Service]
+Type=oneshot
+ExecStart=linode-ddns.sh "${DOMAIN}" "${RECORD}"
diff --git a/systemd/linode-ddns@.timer b/systemd/linode-ddns@.timer
new file mode 100644
index 0000000..d87ed06
--- /dev/null
+++ b/systemd/linode-ddns@.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Regular updates of Linode DDNS
+
+[Timer]
+OnBootSec=2m
+OnUnitActiveSec=30m
+
+[Install]
+WantedBy=timers.target
diff --git a/systemd/linode-ddns@home.example.org.service.d/opts.conf b/systemd/linode-ddns@home.example.org.service.d/opts.conf
new file mode 100644
index 0000000..da136e7
--- /dev/null
+++ b/systemd/linode-ddns@home.example.org.service.d/opts.conf
@@ -0,0 +1,4 @@
+[Service]
+Environment="LINODE_TOKEN=access_token"
+Environment="DOMAIN=example.org"
+Environment="RECORD=home"