diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2001-10-17 14:00:24 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2001-10-17 14:00:24 +0000 |
commit | b9d89fac0e3f53d4946ab94b90cff31da830dacc (patch) | |
tree | 1c2a0b2358a5b22e5fa0967db054af6ca6c7e1f2 /mail/popper | |
parent | Add drweb:drweb automatically (diff) |
Add pop:mail automatically
Diffstat (limited to 'mail/popper')
-rw-r--r-- | mail/popper/scripts/pre-install | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/mail/popper/scripts/pre-install b/mail/popper/scripts/pre-install index efea0df5b772..77e73a2b55b4 100644 --- a/mail/popper/scripts/pre-install +++ b/mail/popper/scripts/pre-install @@ -1,13 +1,29 @@ #!/bin/sh -if ! id -u pop > /dev/null 2>&1; then - echo "You need an account \"pop\" to install this package." - echo "Please add it by hand (try \"man vipw\") and try again." - echo "" - echo "An example passwd entry is:" - echo "pop:*:68:6::0:0:Post Office Owner:/nonexistent:/nonexistent" - echo "" - exit 1 +USER=pop +UID=68 +GID=6 +GROUP=mail + +if ! pw group show "${GROUP}" 2>/dev/null 1>&2; then + if pw groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi fi + +if ! pw user show "${USER}" 2>/dev/null 1>&2; then + if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -s "/sbin/nologin" -d "/nonexistent" -c "Post Office Owner" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi +fi + usrdir=${PREFIX}/etc/popper if [ ! -d $usrdir ]; then mkdir -p $usrdir |