mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-28 05:29:48 +00:00
15e2ad2845
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)
39 lines
832 B
Bash
39 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
|