From d2fe699014beb4eb7cafd84eacb02f4c8ceeded3 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 6 Sep 2005 12:10:46 +0000 Subject: - Update to 2.20 [1] - OPTIONS'ify - Use PORTDOCS - Remove 3 lines pkg-plist - Move dnrd.sh to dnrd.sh.in and use USE_RC_SUBR facility PR: ports/85744 [1] Submitted by: maintainer [1] Reworked by: myself Approved by: maintainer --- dns/dnrd/pkg-install | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 dns/dnrd/pkg-install (limited to 'dns/dnrd/pkg-install') diff --git a/dns/dnrd/pkg-install b/dns/dnrd/pkg-install new file mode 100644 index 000000000000..7266a4efbc96 --- /dev/null +++ b/dns/dnrd/pkg-install @@ -0,0 +1,42 @@ +#!/bin/sh + + +USER=${DNRDUSER:-dnrd} +GROUP=${USER} +SYSCONF_DIR=${SYSCONF_DIR:-${PKG_PREFIX}/etc/dnrd} + +case $2 in + PRE-INSTALL) + if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then + if pw groupadd ${GROUP}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi + fi + + if ! pw usershow "${USER}" 2>/dev/null 1>&2; then + if pw useradd ${USER} -g ${GROUP} -h - \ + -s "/sbin/nologin" -d "/var/empty" \ + -c "DNRD daemon"; \ + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + fi + ;; + + POST-INSTALL) + if [ ! -d ${SYSCONF_DIR} ]; then + mkdir -p ${SYSCONF_DIR} + if [ ! -d ${SYSCONF_DIR} ]; then + echo "Creating \"${SYSCONF_DIR}\" failed." + exit 1 + fi + fi + ;; +esac +exit 0 -- cgit v1.2.3