PREIN
/bin/sh
if [ -n "`getgid ecartis`" ]; then
if [ "`getgid ecartis`" != "64" ]; then
echo "Error: group ecartis doesn't have gid=64. Correct this before installing ecartis." 1>&2
exit 1
fi
else
echo "Adding group ecartis GID=64"
/usr/sbin/groupadd -f -g 64 -r ecartis
fi
if [ -n "`id -u ecartis 2>/dev/null`" ]; then
if [ "`id -u ecartis`" != "64" ]; then
echo "Error: user ecartis doesn't have uid=64. Correct this before installing ecartis." 1>&2
exit 1
fi
else
echo "Adding user ecartis UID=64"
/usr/sbin/useradd -u 64 -r -d /usr/lib/ecartis -s /bin/false -c "Ecartis User" -g ecartis ecartis 1>&2
fi
POSTIN
/bin/sh
# alias:
umask 022
if [ -f /etc/mail/aliases ]; then
if [ -e /etc/smrsh ]; then
if ! grep -q "^ecartis:" /etc/mail/aliases; then
echo "ecartis: \"|/etc/smrsh/ecartis\"" >> /etc/mail/aliases
newaliases || :
fi
else
if ! grep -q "^ecartis:" /etc/mail/aliases; then
echo "ecartis: \"|/usr/lib/ecartis/ecartis\"" >> /etc/mail/aliases
newaliases || :
fi
fi
fi
# mailname:
if [ ! -f /etc/mail/mailname -a -d /etc/mail -a -x /bin/hostname ]; then
hostname -f > /etc/mail/mailname
fi
# Detect SMRSH
if [ -e /etc/smrsh -a ! -e /etc/smrsh/ecartis ]; then
echo "#!/bin/sh" > /etc/smrsh/ecartis
echo "/usr/lib/ecartis/ecartis \$@" >> /etc/smrsh/ecartis
chmod ug+rx /etc/smrsh/ecartis
echo "Your installation has been detected to have SMRSH, the SendMail"
echo "Restricted SHell, installed. If this is your first install, you"
echo "will want to: "
echo ""
echo "1) add 'listserver-bin-dir = /etc/smrsh' to ecartis.cfg"
echo "2) change the address for Ecartis in the aliases file to be"
echo " /etc/smrsh/ecartis instead of /home/ecartis/ecartis"
chmod a+x /etc/smrsh/ecartis
fi
# Force the /usr/lib/ecartis directory permissions to something sane
chmod 711 /usr/lib/ecartis
# Run upgrade
echo "Run upgrade now... "
/usr/lib/ecartis/ecartis -upgrade
exit 0
POSTUN
/bin/sh
if [ "$1" = "0" ]; then
/usr/sbin/userdel ecartis
/usr/sbin/groupdel ecartis
fi
Triggers
listar
/bin/sh
echo "Upgrading from listar..."
if [ -e /etc/smrsh ]; then
ln -sf /etc/smrsh/ecartis /etc/smrsh/listar
fi
echo "Copying lists from listar directories"
cp -R /var/lib/listar/lists /var/lib/ecartis
chown -R ecartis.ecartis /var/lib/ecartis
if [ -e /etc/smrsh ]; then
echo "Making link /etc/smrsh/listar to /etc/smrsh/ecartis:"
ln -sf ecartis /etc/smrsh/listar
fi