PREIN
/bin/sh
if [ -n "`getgid amavis`" ]; then
if [ "`getgid amavis`" != "97" ]; then
echo "Warning: group amavis doesn't have gid=97. Correct this before installing clamav" 1>&2
exit 1
fi
else
echo "adding group amavis GID=97"
/usr/sbin/groupadd -g 97 -r -f amavis
fi
if [ -n "`id -u amavis 2>/dev/null`" ]; then
if [ "`id -u amavis`" != "97" ]; then
echo "Error: user amavis doesn't have uid=97. Correct this before installing amavis." 1>&2
exit 1
fi
else
echo "adding user amavis UID=97"
/usr/sbin/useradd -u 97 -r -d /var/spool/amavis -s /bin/false -c "Anti Virus Checker" -g nobody amavis 1>&2
fi
POSTUN
/bin/sh
if [ "$1" = "0" ]; then
echo "Removing user amavis"
/usr/sbin/userdel amavis
echo "Removing group clamav"
/usr/sbin/groupdel amavis
fi