summaryrefslogtreecommitdiff
path: root/mail/dovecot-devel/pkg-install
diff options
context:
space:
mode:
Diffstat (limited to 'mail/dovecot-devel/pkg-install')
-rw-r--r--mail/dovecot-devel/pkg-install32
1 files changed, 31 insertions, 1 deletions
diff --git a/mail/dovecot-devel/pkg-install b/mail/dovecot-devel/pkg-install
index fb261c272e6a..dbb68998b884 100644
--- a/mail/dovecot-devel/pkg-install
+++ b/mail/dovecot-devel/pkg-install
@@ -52,7 +52,7 @@ if [ x"$2" = xPRE-INSTALL ]; then
fi
fi
- if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
+ if /usr/sbin/pw usershow "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
else
if /usr/sbin/pw useradd ${USER} -g ${GROUP} -h - \
@@ -67,4 +67,34 @@ if [ x"$2" = xPRE-INSTALL ]; then
fi
fi
+ USER=dovecot-auth
+ GROUP=dovecot-auth
+
+ if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if /usr/sbin/pw groupadd ${GROUP} -h -
+ then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+
+ if /usr/sbin/pw usershow "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if /usr/sbin/pw useradd ${USER} -g ${GROUP} -h - \
+ -s /sbin/nologin \
+ -c "Dovecot Auth"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
fi