1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-04 01:48:54 +00:00
freebsd-ports/mail/avenger/pkg-install
Marcus Alves Grando 327c7bafad Update to 0.7
PR:		ports/85064
Submitted by:	David Mazieres <dm+bugs+avenger@mailavenger.org> (maintainer)
Approved by:	pav (mentor)
2005-09-16 22:58:51 +00:00

52 lines
954 B
Bash

#!/bin/sh
if [ -n "${PACKAGE_BUILDING}" ]; then
exit 0
fi
USER=avenger
GROUP=avenger
AVDIR=/var/spool/avenger
PW=/usr/sbin/pw
if [ "$2" = "PRE-INSTALL" ]; then
echo -n "Checking for group '$GROUP'... "
if ! ${PW} groupshow $GROUP >/dev/null 2>&1; then
echo -n "doesn't exist, adding... "
if ${PW} groupadd $GROUP; then
echo "success."
else
echo "FAILED!"
exit 1
fi
else
echo "exists."
fi
echo -n "Checking for user '$USER'... "
if ! ${PW} usershow $USER >/dev/null 2>&1; then
echo -n "doesn't exist, adding... "
if ${PW} useradd $USER -c 'Mail Avenger' \
-d "$AVDIR" -g $GROUP -s /sbin/nologin -h -; then
echo "success."
else
echo "FAILED!"
exit 1
fi
else
echo "exists."
fi
elif [ "$2" = "POST-INSTALL" ]; then
echo "Before using Mail Avenger, you will need to configure it."
echo "Instructions are available in:"
echo ""
echo " ${PKG_PREFIX}/share/avenger/INSTALL"
echo ""
fi
exit 0