c43edd97e5
virus scanners can be run as different users. Submitted by: "Rob MacGregor" <freebsd.macgregor@blueyonder.co.uk>
36 lines
678 B
Bash
36 lines
678 B
Bash
#!/bin/sh
|
|
|
|
[ $# != 2 ] && exit 1
|
|
[ -z "${PKG_PREFIX}" ] && exit 1
|
|
[ -n "${BATCH}" ] && exit 0
|
|
|
|
PKG_NAME=$1
|
|
PKG_ACTION=$2
|
|
MAILUSER=mailnull
|
|
SPOOLDIR=/var/spool/MIMEDefang
|
|
QUARANTINEDIR=/var/spool/MD-Quarantine
|
|
|
|
case "$PKG_ACTION" in
|
|
POST-INSTALL)
|
|
if [ ! -d ${SPOOLDIR} ]; then
|
|
mkdir -p ${SPOOLDIR}
|
|
chown ${MAILUSER}:${MAILUSER} ${SPOOLDIR}
|
|
chmod 710 ${SPOOLDIR}
|
|
fi
|
|
if [ ! -d ${QUARANTINEDIR} ]; then
|
|
mkdir -p ${QUARANTINEDIR}
|
|
chown ${MAILUSER}:${MAILUSER} ${QUARANTINEDIR}
|
|
chmod 700 ${QUARANTINEDIR}
|
|
fi
|
|
;;
|
|
|
|
PRE-INSTALL|POST-DEINSTALL|DEINSTALL)
|
|
;;
|
|
|
|
*)
|
|
echo "usage: $0 <PKG_NAME> {PRE-INSTALL|POST-INSTALL|DEINSTALL|POST-DEINSTALL}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|