blob: 46fe25db3cfed8d4d7ecefd5831959587036e9a5 (
plain)
- #!/bin/bash
- #
- # /usr/local/sbin/init-mailmanarchive
- # Copyright 2002-2002 Jonas Smedegaard <dr@jones.dk>
- #
- # $Id: init-mailmanarchive,v 1.3 2002-10-04 11:24:28 jonas Exp $
- #
- # Rebuild mailman archive(s)
- #
- bindir="/usr/lib/mailman/bin"
- basedir="/var/lib/mailman/archives/private"
- [ $# == 0 ] && echo "Usage: `basename $0` <listname> [<listname>...]"
- for list in $@; do
- mboxdir="$basedir/$list.mbox"
- mboxfile="$mboxdir/$list.mbox"
- htmldir="$basedir/$list"
- if [ "x$1" != "" -a -d $mboxdir ]; then
- echo "Renewing list \"$list\"..."
- # Make sure the mbox file exists even if no mails are archived yet
- touch $mboxfile && chown list.list $mboxfile && chmod 664 $mboxfile
- rm -rf $htmldir
- # $bindir/arch $list
- mkdir -p $htmldir && chown list.list $htmldir && chmod 2755 $htmldir
- su list "mhonarc -outdir $htmldir -idxfname index.html -rcfile /etc/local-COMMON/mailman/mhonarc.mrc -title \"$list Archive (by Date)\" -ttitle \"$list Archive (Threaded)\" $mboxfile"
- echo "Done with list \"$list\"!"
- else
- echo "Problem renewing list \"$list\"."
- fi
- done
|