diff options
author | Stefan Briesenick <sbriesen@gentoo.org> | 2005-10-09 22:48:08 +0000 |
---|---|---|
committer | Stefan Briesenick <sbriesen@gentoo.org> | 2005-10-09 22:48:08 +0000 |
commit | 673571d4783fc9611f2f7cc26af3b347d7280191 (patch) | |
tree | fc23fb81be526ac8dd389db3ac14622a9f23ab67 /net-dns/ez-ipupdate/files | |
parent | Use bindnow-flags instead of -Wl,-z,now. (diff) | |
download | historical-673571d4783fc9611f2f7cc26af3b347d7280191.tar.gz historical-673571d4783fc9611f2f7cc26af3b347d7280191.tar.bz2 historical-673571d4783fc9611f2f7cc26af3b347d7280191.zip |
Switching to debian sources which contain all security fixes. Original source is not available anymore. Ebuild completely rewritten, init-script now handles more than one config. Solving bug #85158.
Package-Manager: portage-2.0.53_rc3
Diffstat (limited to 'net-dns/ez-ipupdate/files')
-rw-r--r-- | net-dns/ez-ipupdate/files/digest-ez-ipupdate-3.0.11_beta8-r2 | 2 | ||||
-rw-r--r-- | net-dns/ez-ipupdate/files/ez-ipupdate.initd | 93 |
2 files changed, 95 insertions, 0 deletions
diff --git a/net-dns/ez-ipupdate/files/digest-ez-ipupdate-3.0.11_beta8-r2 b/net-dns/ez-ipupdate/files/digest-ez-ipupdate-3.0.11_beta8-r2 new file mode 100644 index 000000000000..0448b3422f94 --- /dev/null +++ b/net-dns/ez-ipupdate/files/digest-ez-ipupdate-3.0.11_beta8-r2 @@ -0,0 +1,2 @@ +MD5 42b3cc116dcfd90066b747545dfde465 ez-ipupdate_3.0.11b8-8.1.diff.gz 54073 +MD5 000211add4c4845ffa4211841bff4fb0 ez-ipupdate_3.0.11b8.orig.tar.gz 81975 diff --git a/net-dns/ez-ipupdate/files/ez-ipupdate.initd b/net-dns/ez-ipupdate/files/ez-ipupdate.initd new file mode 100644 index 000000000000..82a9c60aeada --- /dev/null +++ b/net-dns/ez-ipupdate/files/ez-ipupdate.initd @@ -0,0 +1,93 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/ez-ipupdate/files/ez-ipupdate.initd,v 1.1 2005/10/09 22:48:08 sbriesen Exp $ + +opts="${opts} update" + +depend() { + need net +} + +getconfig() { # 0: no daemon / 1: daemon + local CONF NAME LIST="" + for CONF in /etc/ez-ipupdate/*.conf; do + if [ -f "${CONF}" ]; then + # Don't run configurations that are (not) daemons + grep -q '^[[:space:]]*daemon' "${CONF}"; [ $? -eq $1 ] && continue + # Don't run configurations that run in the foreground + grep -q '^[[:space:]]*foreground' "${CONF}" && continue + # add config to list + NAME="${CONF##*/}" + LIST="${LIST} ${NAME%.*}" + fi + done + echo ${LIST} +} + +start() { + local NAME LIST=$(getconfig 1) + + if [ -z "${LIST}" ]; then + eerror "You need at least one config file in /etc/ez-ipupdate" + eerror "containing the 'daemon' keyword and no 'foreground' keyword." + return 1 + fi + + if [ ! -d /var/run/ez-ipupdate ]; then + mkdir -p /var/run/ez-ipupdate && chown ez-ipupd:ez-ipupd /var/run/ez-ipupdate + fi + + for NAME in ${LIST}; do + local CONFIG="/etc/ez-ipupdate/${NAME}.conf" + local PIDFILE="/var/run/ez-ipupdate/${NAME}.pid" + local CACHEFILE="/var/cache/ez-ipupdate/${NAME}.cache" + ebegin "Starting ez-ipupdate (${NAME})" + start-stop-daemon -p "${PIDFILE}" --start --quiet --exec /usr/sbin/ez-ipupdate \ + --chuid ez-ipupd -- -c "${CONFIG}" -F "${PIDFILE}" -b "${CACHEFILE}" + eend $? + done + return 0 # do not fail +} + +stop() { + local PIDFILE NAME + for PIDFILE in /var/run/ez-ipupdate/*.pid; do + if [ -f "${PIDFILE}" ]; then + NAME="${PIDFILE##*/}" + ebegin "Stopping ez-ipupdate (${NAME%.*})" + start-stop-daemon --stop --signal QUIT --quiet --pidfile "${PIDFILE}" + eend $? || rm -f "${PIDFILE}" + else + eerror "No running ez-ipupdate process" + fi + done + return 0 # do not fail +} + +update() { + local NAME TEXT LIST=$(getconfig 0) + + if [ -z "${LIST}" ]; then + eerror "You need at least one config file in /etc/ez-ipupdate" + eerror "containing no 'daemon' and 'foreground' keyword." + return 1 + fi + + for NAME in ${LIST}; do + local CONFIG="/etc/ez-ipupdate/${NAME}.conf" + local CACHEFILE="/var/cache/ez-ipupdate/${NAME}.cache" + ebegin "Running ez-ipupdate (${NAME})" + TEXT=$(/usr/sbin/ez-ipupdate -q -R ez-ipupd -c "${CONFIG}" -b "${CACHEFILE}" 2>&1) + if eend $?; then + if [ -n "${TEXT}" ]; then + while read line; do einfo " $line"; done < <(echo "${TEXT}") + fi + else + if [ -n "${TEXT}" ]; then + while read line; do eerror " $line"; done < <(echo "${TEXT}") + fi + fi + done + return 0 # do not fail +} |