summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2016-01-03 11:45:14 +0100
committerMartin Väth <martin@mvath.de>2016-01-03 11:45:14 +0100
commit126b94a63ea6a4f41878993a5d727b50daeacee3 (patch)
treeda0ef8ef08897c37ed6275dde00bac91623a9437 /net-dns/noip-updater/files
parentapp-shells/zsh: Make repoman happy (diff)
downloadmv-126b94a63ea6a4f41878993a5d727b50daeacee3.tar.gz
mv-126b94a63ea6a4f41878993a5d727b50daeacee3.tar.bz2
mv-126b94a63ea6a4f41878993a5d727b50daeacee3.zip
net-dns/noip-updater: Copy from gentoo repository to save from removal.
Bump to EAPI=6. Support optionally user ez-ipupd instead of nobody. Fix initscript: runscript->openrc-run, avoid bashism.
Diffstat (limited to 'net-dns/noip-updater/files')
-rw-r--r--net-dns/noip-updater/files/noip-2.1.9-daemon.patch21
-rw-r--r--net-dns/noip-updater/files/noip-2.1.9-flags.patch11
-rw-r--r--net-dns/noip-updater/files/noip.service12
-rw-r--r--net-dns/noip-updater/files/noip2.start34
4 files changed, 78 insertions, 0 deletions
diff --git a/net-dns/noip-updater/files/noip-2.1.9-daemon.patch b/net-dns/noip-updater/files/noip-2.1.9-daemon.patch
new file mode 100644
index 00000000..b2fb4e66
--- /dev/null
+++ b/net-dns/noip-updater/files/noip-2.1.9-daemon.patch
@@ -0,0 +1,21 @@
+diff -ur a/noip2.c b/noip2.c
+--- a/noip2.c 2004-01-09 14:18:39.000000000 +0000
++++ b/noip2.c 2007-07-20 14:02:41.100377515 +0100
+@@ -895,16 +895,13 @@
+ char *err_string;
+ static int startup = 1;
+
+- x = fork();
++ x = daemon (0, 0);
+ switch (x) {
+ case -1: // error
+ err_string = strerror(errno);
+ Msg( "Can't fork!! (%s) Ending!\n", err_string);
+ return FATALERR;
+- default: // parent
+- exit(0);
+ case 0: //child
+- setsid();
+ if (get_shm_info() == FATALERR)
+ return FATALERR;
+ log2syslog++;
diff --git a/net-dns/noip-updater/files/noip-2.1.9-flags.patch b/net-dns/noip-updater/files/noip-2.1.9-flags.patch
new file mode 100644
index 00000000..9fe05f36
--- /dev/null
+++ b/net-dns/noip-updater/files/noip-2.1.9-flags.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2006-09-07 09:52:55.000000000 +0200
++++ b/Makefile 2006-09-07 09:54:54.000000000 +0200
+@@ -21,7 +21,7 @@
+ # ARCH=sun
+
+ ${TGT}: Makefile ${TGT}.c
+- ${CC} -Wall -g -D${ARCH} -DPREFIX=\"${PREFIX}\" ${TGT}.c -o ${TGT} ${LIBS}
++ ${CC} ${CFLAGS} -D${ARCH} -DPREFIX=\"${PREFIX}\" ${TGT}.c -o ${TGT} ${LIBS} ${LDFLAGS}
+
+ install: ${TGT}
+ if [ ! -d ${BINDIR} ]; then mkdir -p ${BINDIR};fi
diff --git a/net-dns/noip-updater/files/noip.service b/net-dns/noip-updater/files/noip.service
new file mode 100644
index 00000000..b4834e84
--- /dev/null
+++ b/net-dns/noip-updater/files/noip.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=No-IP Dynamic DNS Update Client
+Require=network-online.target
+After=network-online.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/noip2 -c /etc/no-ip2.conf
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/net-dns/noip-updater/files/noip2.start b/net-dns/noip-updater/files/noip2.start
new file mode 100644
index 00000000..20723ab2
--- /dev/null
+++ b/net-dns/noip-updater/files/noip2.start
@@ -0,0 +1,34 @@
+#!/sbin/openrc-run
+
+depend() {
+ need localmount
+ need net
+ use dns
+}
+
+checkconfig() {
+ if [ ! -f /etc/no-ip2.conf ]
+ then
+ einfo "Answer the following questions about your no-ip account."
+ noip2 -C || return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting noip"
+ start-stop-daemon --quiet --start -x /usr/sbin/noip2 -- -c /etc/no-ip2.conf
+ eend $? "noip did not start, error code $?"
+}
+
+stop() {
+ ebegin "Stopping noip"
+ start-stop-daemon --quiet --stop -x /usr/sbin/noip2
+ noip_ecode=$?
+ eend $noip_ecode "Error stopping the noip daemon, error $noip_ecode"
+ checkconfig || return 1
+ ebegin "Setting noip addresses to 0.0.0.0"
+ noip2 -c /etc/no-ip2.conf -i 0.0.0.0 >/dev/null 2>&1
+ eend $? "Failed to set noip addresses to 0.0.0.0, error $?"
+ return $noip_ecode
+}