summaryrefslogtreecommitdiff
path: root/init-mailmanarchive
blob: edcc24084f55bdf9a6661bb0ec4d150b97b35e88 (plain)
  1. #!/bin/bash
  2. bindir="/usr/lib/mailman/bin"
  3. basedir="/var/lib/mailman/archives/private"
  4. [ $# == 0 ] && echo "Usage: `basename $0` <listname> [<listname>...]"
  5. for list in $@; do
  6. mboxdir="$basedir/$list.mbox"
  7. mboxfile="$mboxdir/$list.mbox"
  8. htmldir="$basedir/$list"
  9. if [ "x$1" != "" -a -d $mboxdir ]; then
  10. echo "Renewing list \"$list\"..."
  11. # Make sure the mbox file exists even if no mails are archived yet
  12. touch $mboxfile && chown list.list $mboxfile && chmod 664 $mboxfile
  13. rm -rf $htmldir
  14. # $bindir/arch $list
  15. mkdir -p $htmldir && chown list.list $htmldir && chmod 2755 $htmldir
  16. su list "mhonarc -outdir $htmldir -idxfname index.html -rcfile /etc/mailman/mhonarc.mrc -title \"$list Archive (by Date)\" -ttitle \"$list Archive (Threaded)\" $mboxfile"
  17. echo "Done with list \"$list\"!"
  18. else
  19. echo "Problem renewing list \"$list\"."
  20. fi
  21. done