#!/usr/bin/env zsh # ZSH 4+ script to create indexes for archives ARCHIVES_PATH=$HOME/archives/mbox-archives.conf if [ $# -ge 1 ]; then ARCHIVES_PATH="$1" fi if [ ! -f $ARCHIVES_PATH ] ; then echo $ARCHIVES_PATH not found. Exiting. exit 1 fi source $ARCHIVES_PATH cat > $MBOX_DIR/index.html < Available Mailing Lists

Welcome to the mail archives on $SERVER_NAME.

    EOF (( mid_count = ${#ARCHIVES} / 2 )) count=0 for i in ${ARCHIVES} ; do dirname=${${(P)i}[1]} mboxtype=${${(P)i}[2]} mboxpath=${${(P)i}[3]} tlpname=`echo $dirname | cut -d '-' -f 1` listname=`echo $dirname | cut -d '-' -f 2-` #echo Updating $dirname index $listname @ $tlpname echo "
  • $listname@$tlpname.apache.org
  • " >> $MBOX_DIR/index.html if [ $count -eq $mid_count ]; then cat >> $MBOX_DIR/index.html <
    EOF fi (( count = $count + 1 )) done cat >> $MBOX_DIR/index.html <
EOF