fc52284375
- new thread manager (with better SMP support) - new switch ArchiveDetectEncrypted - new directive: ArchiveDetectEncrypted - see /usr/local/share/doc/clamav/NEWS - install html documentation to /usr/local/share/doc/clamav/html added CLAMAVUSER/CLAMAVGROUP support Adopted the port to ensure timely fixes in case I broke something :P Please reset the maintainer if TERAMOTO Masahiro shows up again.
56 lines
1.2 KiB
Bash
56 lines
1.2 KiB
Bash
#!/bin/sh
|
|
# $FreeBSD$
|
|
|
|
PREFIX=${PKG_PREFIX:-%%PREFIX%%}
|
|
|
|
CLAMAVUSER=%%CLAMAVUSER%%
|
|
CLAMAVGROUP=%%CLAMAVGROUP%%
|
|
|
|
CLAMRUN=/var/run/clamav
|
|
CLAMLOG=/var/log/clamav
|
|
DATADIR=%%DATADIR%%
|
|
|
|
if [ "$2" = "PRE-INSTALL" ]; then
|
|
|
|
if ! pw groupshow "$CLAMAVGROUP" 2>/dev/null 1>&2; then
|
|
if pw groupadd $CLAMAVGROUP; then
|
|
echo "=> Added group \"$CLAMAVGROUP\"."
|
|
else
|
|
echo "=> Adding group \"$CLAMAVGROUP\" failed..."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if ! pw usershow "$CLAMAVUSER" 2>/dev/null 1>&2; then
|
|
if pw useradd $CLAMAVUSER -g $CLAMAVGROUP -h - \
|
|
-s "/sbin/nologin" -d "/nonexistent" \
|
|
-c "Clam Antivirus"; \
|
|
then
|
|
pw groupmod mail -m $CLAMAVUSER
|
|
echo "=> Added user \"$CLAMAVUSER\"."
|
|
else
|
|
echo "=> Adding user \"$CLAMAVUSER\" failed..."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
elif [ "$2" = "POST-INSTALL" ]; then
|
|
|
|
if [ ! -d "$CLAMRUN" ]; then
|
|
mkdir -p "$CLAMRUN" || exit 1
|
|
chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMRUN" || exit 1
|
|
fi
|
|
|
|
if [ ! -d "$CLAMLOG" ]; then
|
|
mkdir -p "$CLAMLOG" || exit 1
|
|
chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMLOG" || exit 1
|
|
fi
|
|
|
|
if [ ! -d "${DATADIR}" ]; then
|
|
mkdir -p "$DATADIR" || exit 1
|
|
chown "$CLAMAVUSER:$CLAMAVGROUP" "$DATADIR" || exit 1
|
|
fi
|
|
|
|
fi
|
|
|
|
exit 0
|