2005-05-10 01:19:58 +02:00
|
|
|
#!/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... "
|
2005-07-08 14:13:20 +02:00
|
|
|
if ${PW} groupadd $GROUP; then
|
2005-05-10 01:19:58 +02:00
|
|
|
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... "
|
2005-09-17 00:58:51 +02:00
|
|
|
if ${PW} useradd $USER -c 'Mail Avenger' \
|
|
|
|
-d "$AVDIR" -g $GROUP -s /sbin/nologin -h -; then
|
2005-05-10 01:19:58 +02:00
|
|
|
echo "success."
|
|
|
|
else
|
|
|
|
echo "FAILED!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "exists."
|
|
|
|
fi
|
|
|
|
elif [ "$2" = "POST-INSTALL" ]; then
|
2005-09-17 00:58:51 +02:00
|
|
|
echo "Before using Mail Avenger, you will need to configure it."
|
|
|
|
echo "Instructions are available in:"
|
|
|
|
echo ""
|
|
|
|
echo " ${PKG_PREFIX}/share/avenger/INSTALL"
|
|
|
|
echo ""
|
2005-05-10 01:19:58 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|