diff options
author | Renato Botelho <garga@FreeBSD.org> | 2005-09-06 12:10:46 +0000 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2005-09-06 12:10:46 +0000 |
commit | d2fe699014beb4eb7cafd84eacb02f4c8ceeded3 (patch) | |
tree | 3d5def4c4ed691ac03f81f1f904de361efca7f2b /dns/dnrd/pkg-install | |
parent | 75bd01ebf602bfe7b7eb8f456b930e21534b2771 (diff) | |
download | ports-d2fe699014beb4eb7cafd84eacb02f4c8ceeded3.tar.gz ports-d2fe699014beb4eb7cafd84eacb02f4c8ceeded3.zip |
Notes
Diffstat (limited to 'dns/dnrd/pkg-install')
-rw-r--r-- | dns/dnrd/pkg-install | 42 |
1 files changed, 42 insertions, 0 deletions
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 |