summaryrefslogtreecommitdiff
path: root/net-dns/ddclient/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-dns/ddclient/files
reinit the tree, so we can have metadata
Diffstat (limited to 'net-dns/ddclient/files')
-rw-r--r--net-dns/ddclient/files/cmd-over-cfg.patch11
-rw-r--r--net-dns/ddclient/files/ddclient.confd2
-rw-r--r--net-dns/ddclient/files/ddclient.confd-r12
-rw-r--r--net-dns/ddclient/files/ddclient.initd-r357
-rw-r--r--net-dns/ddclient/files/ddclient.initd-r435
-rw-r--r--net-dns/ddclient/files/ddclient.service12
-rw-r--r--net-dns/ddclient/files/iproute2.patch30
7 files changed, 149 insertions, 0 deletions
diff --git a/net-dns/ddclient/files/cmd-over-cfg.patch b/net-dns/ddclient/files/cmd-over-cfg.patch
new file mode 100644
index 000000000000..9033873fde74
--- /dev/null
+++ b/net-dns/ddclient/files/cmd-over-cfg.patch
@@ -0,0 +1,11 @@
+--- ddclient.old 2011-11-13 10:14:59.957846596 -0500
++++ ddclient 2011-11-13 10:18:33.864245944 -0500
+@@ -773,7 +773,7 @@
+ foreach my $h (sort keys %config) {
+ next if $config{$h}{'protocol'} ne lc($s);
+ $examined{$h} = 1;
+- my $use = $config{$h}{'use'} || opt('use');
++ my $use = opt('use') || $config{$h}{'use'};
+ local $opt{$use} = $config{$h}{$use} if $config{$h}{$use};
+ # bug #13: we should only do this once
+ # use isn't enough, we have to save the origin to.
diff --git a/net-dns/ddclient/files/ddclient.confd b/net-dns/ddclient/files/ddclient.confd
new file mode 100644
index 000000000000..2408a40bb6f4
--- /dev/null
+++ b/net-dns/ddclient/files/ddclient.confd
@@ -0,0 +1,2 @@
+# No need to specify a pid in /etc/ddclient/ddclient.conf
+PIDFILE=/var/run/ddclient/ddclient.pid
diff --git a/net-dns/ddclient/files/ddclient.confd-r1 b/net-dns/ddclient/files/ddclient.confd-r1
new file mode 100644
index 000000000000..69ad0eeff87d
--- /dev/null
+++ b/net-dns/ddclient/files/ddclient.confd-r1
@@ -0,0 +1,2 @@
+# No need to specify a pid in /etc/ddclient/ddclient.conf
+#PIDFILE=/var/run/ddclient/ddclient.pid
diff --git a/net-dns/ddclient/files/ddclient.initd-r3 b/net-dns/ddclient/files/ddclient.initd-r3
new file mode 100644
index 000000000000..e0606a60b11c
--- /dev/null
+++ b/net-dns/ddclient/files/ddclient.initd-r3
@@ -0,0 +1,57 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ -d /run ] ; then
+ PIDFILE=${PIDFILE:-/run/ddclient/ddclient.pid}
+else
+ PIDFILE=${PIDFILE:-/var/run/ddclient/ddclient.pid}
+fi
+
+depend() {
+ before cron
+ need net
+ use dns logger squid
+}
+
+checkconfig() {
+ local conf="/etc/ddclient/ddclient.conf"
+
+ if [ -e "${conf}" ] ; then
+ if [ -n "$(find /etc/ddclient -maxdepth 1 -name ddclient.conf -perm +0044)" ] ; then
+ eerror "${conf} must not be world or group readable. Try:"
+ eerror " chmod 600 ${conf}"
+ eerror " chown ddclient:ddclient ${conf}"
+ return 1
+ fi
+ else
+ eerror "${conf} is needed to run ddclient"
+ eerror "There is a sample file in /etc/ddclient/"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ local piddir=$(dirname ${PIDFILE})
+ if [ ! -d ${piddir} ] ; then
+ ebegin "Making ${piddir}"
+ mkdir -p ${piddir}
+ eend $?
+ ebegin "Changing permissions of ${piddir}"
+ chown ddclient:ddclient ${piddir}
+ eend $?
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --user ddclient --exec /usr/sbin/ddclient \
+ --name ddclient --pidfile ${PIDFILE} -- -pid=${PIDFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --signal USR1 --pidfile ${PIDFILE}
+ eend $?
+}
diff --git a/net-dns/ddclient/files/ddclient.initd-r4 b/net-dns/ddclient/files/ddclient.initd-r4
new file mode 100644
index 000000000000..c25f02965196
--- /dev/null
+++ b/net-dns/ddclient/files/ddclient.initd-r4
@@ -0,0 +1,35 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PIDFILE="/run/ddclient/ddclient.pid"
+
+depend() {
+ before cron
+ need net
+ use dns logger squid
+}
+
+checkconfig() {
+ checkpath -f -m 0600 -o ddclient:ddclient /etc/ddclient/ddclient.conf || return 1
+ checkpath -d -m 0700 -o ddclient:ddclient /run/ddclient || return 1
+ checkpath -d -m 0700 -o ddclient:ddclient /var/cache/ddclient || return 1
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start \
+ --user ddclient \
+ --name ddclient \
+ --pidfile ${PIDFILE} \
+ --exec /usr/sbin/ddclient -- -pid=${PIDFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --signal USR1 --pidfile ${PIDFILE}
+ eend $?
+}
diff --git a/net-dns/ddclient/files/ddclient.service b/net-dns/ddclient/files/ddclient.service
new file mode 100644
index 000000000000..e2d3608d44d4
--- /dev/null
+++ b/net-dns/ddclient/files/ddclient.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Dynamic DNS Update Client
+After=network.target
+ConditionPathExists=/etc/ddclient/ddclient.conf
+
+[Service]
+ExecStart=/usr/sbin/ddclient --foreground
+User=ddclient
+Group=ddclient
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-dns/ddclient/files/iproute2.patch b/net-dns/ddclient/files/iproute2.patch
new file mode 100644
index 000000000000..f81dd8c00d82
--- /dev/null
+++ b/net-dns/ddclient/files/iproute2.patch
@@ -0,0 +1,30 @@
+diff -u a/ddclient b/ddclient
+--- a/ddclient 2011-07-11 17:04:21.000000000 -0400
++++ b/ddclient 2011-08-12 20:13:15.980466303 -0400
+@@ -588,7 +588,7 @@
+ [ "ip", "=s", "-ip address : set the IP address to 'address'" ],
+ "",
+ [ "if", "=s", "-if interface : obtain IP address from 'interface'" ],
+- [ "if-skip", "=s", "-if-skip pattern : skip any IP addresses before 'pattern' in the output of ifconfig {if}" ],
++ [ "if-skip", "=s", "-if-skip pattern : skip any IP addresses before 'pattern' in the output of ip addr show {if}" ],
+ "",
+ [ "web", "=s", "-web provider|url : obtain IP address from provider's IP checking page" ],
+ [ "web-skip", "=s", "-web-skip pattern : skip any IP addresses before 'pattern' on the web provider|url" ],
+@@ -1316,7 +1316,7 @@
+
+ {
+ local $opt{'use'} = 'if';
+- foreach my $if (grep {/^[a-zA-Z]/} `ifconfig -a`) {
++ foreach my $if (grep {/^[a-zA-Z]/} `ip addr show`) {
+ $if =~ s/:?\s.*//is;
+ local $opt{'if'} = $if;
+ printf "use=if, if=%s address is %s\n", opt('if'), define(get_ip('if'), 'NOT FOUND');
+@@ -1937,7 +1937,7 @@
+
+ } elsif ($use eq 'if') {
+ $skip = opt('if-skip', $h) || '';
+- $reply = `ifconfig $arg 2> /dev/null`;
++ $reply = `ip addr show $arg 2> /dev/null`;
+ $reply = '' if $?;
+
+ } elsif ($use eq 'cmd') {