aboutsummaryrefslogtreecommitdiff
path: root/mail/qmail-scanner1/pkg-install
diff options
context:
space:
mode:
authorSergei Kolobov <sergei@FreeBSD.org>2003-12-11 11:40:35 +0000
committerSergei Kolobov <sergei@FreeBSD.org>2003-12-11 11:40:35 +0000
commit46a4563118d992f8c05b8f3dbfb42d326e3e030b (patch)
treec9efc792f8edbaa084463d138bfd0b73adf1c14e /mail/qmail-scanner1/pkg-install
parent46868c18ec62f84c03d8debccbfd877f98bf8d1b (diff)
Notes
Diffstat (limited to 'mail/qmail-scanner1/pkg-install')
-rw-r--r--mail/qmail-scanner1/pkg-install43
1 files changed, 43 insertions, 0 deletions
diff --git a/mail/qmail-scanner1/pkg-install b/mail/qmail-scanner1/pkg-install
new file mode 100644
index 000000000000..414c1f77bb1b
--- /dev/null
+++ b/mail/qmail-scanner1/pkg-install
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+CHMOD=/bin/chmod
+CHOWN=/usr/sbin/chown
+MKDIR=/bin/mkdir
+PW=/usr/sbin/pw
+
+GU_ID=98
+GU_NAME=qscand
+
+PREFIX=${PKG_PREFIX}
+SPOOLDIR=${PREFIX}/qmailscan
+
+case "$2" in
+PRE-INSTALL)
+ # User and group
+ ${PW} groupshow -n ${GU_NAME} >/dev/null 2>&1 \
+ || ${PW} groupadd -n ${GU_NAME} -g ${GU_ID}
+ ${PW} usershow -n ${GU_NAME} >/dev/null 2>&1 \
+ || ${PW} useradd ${GU_NAME} -g ${GU_NAME} -u ${GU_ID} -s /sbin/nologin
+ ${MKDIR} -p ${SPOOLDIR}
+ ;;
+POST-INSTALL)
+ # Directories
+ for i in quarantine working archives; do
+ for j in tmp cur new; do
+ ${MKDIR} -p ${SPOOLDIR}/$i/$j
+ done
+ done
+ ${MKDIR} -p ${SPOOLDIR}/tmp
+
+ # Mod and owner
+ ${CHOWN} ${GU_NAME}:${GU_NAME} ${PREFIX}/bin/qmail-scanner-queue.pl
+ ${CHMOD} 4755 ${PREFIX}/bin/qmail-scanner-queue.pl
+
+ # Initialize
+ ${PREFIX}/bin/qmail-scanner-queue.pl -z
+ ${PREFIX}/bin/qmail-scanner-queue.pl -g
+
+ # Mod and owner (final)
+ ${CHOWN} -R ${GU_NAME}:${GU_NAME} ${SPOOLDIR}
+ ;;
+esac