1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
#!/bin/bash
# This script is a modified version of the one originally used by majordomo.
# Allow this part to fail.
set +e
UNAME=listar
HOMEDIR=/usr/lib/listar
if ! grep -q "^${UNAME}:.*${HOMEDIR}" /etc/passwd
then
adduser --system --home $HOMEDIR --group $UNAME
else
echo "Listar account already in place; not modifying."
fi
if ! grep -q "^${UNAME}:.*${HOMEDIR}" /etc/passwd
then
echo Failed to create user $UNAME
exit 1
fi
if ! grep -q \^${UNAME}: /etc/group
then
echo Failed to create group $UNAME
exit 1
fi
# Restore normal error checking
set -e
if [ `grep ^listar: /etc/passwd | cut -d: -f7` = '/bin/false' ] ; then
chsh -s /bin/sh listar
fi
# Tag everything with proper permissions.
touch /var/log/listar.log
chown -R listar.listar /usr/lib/listar /var/lib/listar /etc/listar /var/log/listar.log
chown listar.daemon /usr/lib/listar/listar
chmod 4755 /usr/lib/listar/listar
chmod o-rwx /var/lib/listar/{lists,queue}
#if [ $1 = "configure" -a $2 != "0.129a" ] ; then
if [ $1 = "configure" ] ; then
su listar -s /bin/sh -c '/usr/lib/listar/listar -upgrade'
echo "If you are upgrading and have virtual listar hosts set up,"
echo "you will want to run this:"
echo "su listar -c '/usr/lib/listar/listar -c vhost-cfg-file -upgrade'"
echo " "
echo "Press Enter to continue"
read
fi
#DEBHELPER#
cat <<EOF
Listar is now installed on your system. However, it is not yet ready for
use. Before using Listar, you will need to modify some listar configuration
files in /etc/listar, add things to your /etc/aliases file, and set up a
mailing list. More details can be found in /usr/share/doc/listar, especially
the file README.Debian in that directory.
Press Enter to continue.
EOF
read resp
|