aboutsummaryrefslogtreecommitdiffstats
path: root/mail/fetchmail/pkg-install
diff options
context:
space:
mode:
authorbarner <barner@FreeBSD.org>2006-05-13 00:58:48 +0800
committerbarner <barner@FreeBSD.org>2006-05-13 00:58:48 +0800
commitc714505fb930a6e483d707c273dfd0f8b8e9d828 (patch)
treeb1eb8c117cf2a42d71731629b6b3e2c60ef13a59 /mail/fetchmail/pkg-install
parent1778a5c57c0aa61018edb65afbecd42b8e17d250 (diff)
downloadfreebsd-ports-gnome-c714505fb930a6e483d707c273dfd0f8b8e9d828.tar.gz
freebsd-ports-gnome-c714505fb930a6e483d707c273dfd0f8b8e9d828.tar.zst
freebsd-ports-gnome-c714505fb930a6e483d707c273dfd0f8b8e9d828.zip
- Update to 6.3.4 [1]
- Add rcNG script. See $PREFIX/etc/rc.d/fetchmail for instructions. Inspired by [2] and ports/www/apache22. PR: ports/96987 [1], ports/96079 Submitted by: Rob MacGregor <freebsd.macgregor@blueyonder.co.uk> [1], Martin Jackson <mhjacks@swbell.net>
Diffstat (limited to 'mail/fetchmail/pkg-install')
-rw-r--r--mail/fetchmail/pkg-install44
1 files changed, 44 insertions, 0 deletions
diff --git a/mail/fetchmail/pkg-install b/mail/fetchmail/pkg-install
new file mode 100644
index 000000000000..f7b4a2857948
--- /dev/null
+++ b/mail/fetchmail/pkg-install
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+
+if [ -x /usr/sbin/nologin ]; then
+ NOLOGIN=/usr/sbin/nologin
+else
+ NOLOGIN=/sbin/nologin
+fi
+
+if [ x"$2" = xPRE-INSTALL ]; then
+ USER=fetchmail
+ UID=124
+ GROUP=fetchmail
+ GID=124
+
+ 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} -g ${GID}
+ 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 user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d /var/run/fetchmail -s ${NOLOGIN} -c "Fetchmail mail-retrieval daemon"; then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+fi