freebsd-ports/security/clamav/pkg-install
Norikatsu Shigemura 15e2ad2845 o Add mirror site.
o Remove unnecsesary patches for current.
o Add/remove users when installing/removing.
o Set permissions on virus database dir.

PR:		ports/53305
Submitted by:	Rob Evers<rob@debank.tv>
Approved by:	TERAMOTO Masahiro <markun@onohara.to> (maintainer)
2003-06-18 09:43:05 +00:00

38 lines
832 B
Bash

#!/bin/sh
if [ "$2" = "PRE-INSTALL" ]; then
USER=clamav
GROUP=clamav
if ! pw groupshow "$GROUP" 2>/dev/null 1>&2; then
if pw groupadd $GROUP; then
echo "=> Added group \"$GROUP\"."
else
echo "=> Adding group \"$GROUP\" failed..."
exit 1
fi
fi
if ! pw usershow "$USER" 2>/dev/null 1>&2; then
if pw useradd $USER -g $GROUP -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-c "Clam Antivirus"; \
then
echo "=> Added user \"$USER\"."
else
echo "=> Adding user \"$USER\" failed..."
exit 1
fi
fi
fi
if [ "$2" = "POST-INSTALL" ]; then
chown -R clamav:clamav ${PKG_PREFIX}/share/clamav
fi
if [ "$2" != "POST-INSTALL" ] && [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
exit 0