aboutsummaryrefslogtreecommitdiffstats
path: root/mail/popper
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-10-17 22:00:24 +0800
committerache <ache@FreeBSD.org>2001-10-17 22:00:24 +0800
commit60a6a578fd47c90d1fe5eceeb1a5c5474ac2feff (patch)
treeac51c6775c3e852f1888939afef22afe79c81f69 /mail/popper
parent1238343b7de7ba0e702cd4ae6b4eb8bc68c8f6b9 (diff)
downloadfreebsd-ports-gnome-60a6a578fd47c90d1fe5eceeb1a5c5474ac2feff.tar.gz
freebsd-ports-gnome-60a6a578fd47c90d1fe5eceeb1a5c5474ac2feff.tar.zst
freebsd-ports-gnome-60a6a578fd47c90d1fe5eceeb1a5c5474ac2feff.zip
Add pop:mail automatically
Diffstat (limited to 'mail/popper')
-rw-r--r--mail/popper/scripts/pre-install32
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