summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormesmerx2016-11-01 16:32:20 -0200
committermesmerx2016-11-01 16:32:20 -0200
commitb5ab0b8f72db69f1be25c5ce98acec583f2a3387 (patch)
tree3b1224f6943a4c321061e9cc93dc03a52ae3c8ef
parent0afe759ea8f7f7dd8e2cdac8a2281c0c1490c88b (diff)
downloadaur-b5ab0b8f72db69f1be25c5ce98acec583f2a3387.tar.gz
newversion
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD17
-rw-r--r--default.cfg2
-rw-r--r--duckdns.install6
-rw-r--r--duckdns.service6
-rwxr-xr-xduckdns.sh17
-rw-r--r--duckdns.timer8
7 files changed, 60 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c15ab4ef8a3..14930e0f4ee 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,19 @@
pkgbase = duckdns
pkgdesc = Update your DuckDNS.org entries from your computer without setting up any cronjob. You just need to create config files for your domains.
- pkgver = 1.0.0
+ pkgver = 1.0.1
pkgrel = 1
- url = https://stroobants.io
+ url = https://www.duckdns.org
+ install = duckdns.install
arch = any
- license = MIT
backup = etc/duckdns.d/default.cfg
- source = https://stroobants.io/wp-content/uploads/2015/09/duckdns-1.0.0.tar.gz
- md5sums = 78ea999eaa92e8b005464ca37544cf62
+ source = default.cfg
+ source = duckdns.service
+ source = duckdns.timer
+ source = duckdns.sh
+ md5sums = 4cad7ae6c25b8148916fc702f4846a6f
+ md5sums = b478880b19c7c403c8f8b2e80292c789
+ md5sums = 891ca4358eca8d9c2c1994aa3025fa04
+ md5sums = 1bcd62ec5cec5ca5618d2dd2901c66e1
pkgname = duckdns
diff --git a/PKGBUILD b/PKGBUILD
index 9314668e8a0..21c383da7e6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,21 +1,23 @@
# Maintainer: Tom Stroobants <stroobantstom@gmail.com>
pkgname=duckdns
-pkgver=1.0.0
+pkgver=1.0.1
pkgrel=1
pkgdesc="Update your DuckDNS.org entries from your computer without setting up any cronjob. You just need to create config files for your domains."
arch=('any')
-url="https://stroobants.io"
-license=('MIT')
+install=${pkgname}.install
+url="https://www.duckdns.org"
backup=("etc/duckdns.d/default.cfg")
-source=("https://stroobants.io/wp-content/uploads/2015/09/${pkgname}-${pkgver}.tar.gz")
-md5sums=('78ea999eaa92e8b005464ca37544cf62')
+source=('default.cfg' 'duckdns.service' 'duckdns.timer' 'duckdns.sh')
+md5sums=('4cad7ae6c25b8148916fc702f4846a6f'
+ 'b478880b19c7c403c8f8b2e80292c789'
+ '891ca4358eca8d9c2c1994aa3025fa04'
+ '1bcd62ec5cec5ca5618d2dd2901c66e1')
+
package() {
- cd ${pkgname}
install -D duckdns.sh "${pkgdir}/usr/bin/${pkgname}"
- install -D LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -d "${pkgdir}/etc/duckdns.d/"
@@ -26,3 +28,4 @@ package() {
}
+
diff --git a/default.cfg b/default.cfg
new file mode 100644
index 00000000000..2344ba361ca
--- /dev/null
+++ b/default.cfg
@@ -0,0 +1,2 @@
+duckdns_hostname=
+duckdns_token=
diff --git a/duckdns.install b/duckdns.install
new file mode 100644
index 00000000000..9371a19c152
--- /dev/null
+++ b/duckdns.install
@@ -0,0 +1,6 @@
+post_install() {
+ echo "Please edit /etc/duckdns.d/default.cfg, and change your token and server"
+}
+post_upgrade() {
+ echo "Please edit /etc/duckdns.d/default.cfg,and change your token and server"
+}
diff --git a/duckdns.service b/duckdns.service
new file mode 100644
index 00000000000..514769a37d4
--- /dev/null
+++ b/duckdns.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=DuckDNS update job
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/duckdns \ No newline at end of file
diff --git a/duckdns.sh b/duckdns.sh
new file mode 100755
index 00000000000..2503a3a1219
--- /dev/null
+++ b/duckdns.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+logger -t DuckDNS "Updating DuckDNS entries"
+EXITCODE=0
+for file in /etc/duckdns.d/*.cfg
+do
+ source "${file}"
+ logger -t DuckDNS "Executing config file '${file}'"
+ OUTPUT=$(curl -k -s "https://www.duckdns.org/update?domains=${duckdns_hostname}&token=${duckdns_token}&ip=")
+ logger -t DuckDNS ${OUTPUT}
+ if [ "${OUTPUT}" == "KO" ]; then
+ logger -t DuckDNS "You should check if your domain/token is correct because the server responded negatively!"
+ $EXITCODE=1
+ fi
+done
+
+exit $EXITCODE \ No newline at end of file
diff --git a/duckdns.timer b/duckdns.timer
new file mode 100644
index 00000000000..1f00c613ccc
--- /dev/null
+++ b/duckdns.timer
@@ -0,0 +1,8 @@
+[Unit]
+Description=Run DuckDNS every 5 minutes
+
+[Timer]
+OnCalendar=*:0/15
+
+[Install]
+WantedBy=timers.target