#!/bin/sh

choices () {
    echo 'mediawiki MediaWiki'
    echo 'wordpress WordPress'
    echo 'joomla Joomla'
    echo 'e107 e107'
    echo 'gallery2 Gallery2'
    echo 'phpbb phpBB'
    echo 'advancedbook Advanced Guest Book'
    echo 'phpical PHP iCalendar'
    echo 'trac Trac'
    echo 'turbogears TurboGears'
    echo 'django Django'
}

nchoices=`choices | wc -l`

echo
echo "What piece of software would you like to install?"
echo
choices | sed 's/^[^ ]* //' | cat -n
echo
printf "Please enter a number 1-%d: " "$nchoices"
read num
echo

attach scripts 2>/dev/null
choice=`choices | sed -n "$num { s/ .*$//; p; }"`
if [ -n "$choice" ]; then
  . "/mit/scripts/bin$scriptsdev/scripts-$choice"
else
  echo "ERROR:"
  echo "You must enter a number 1 through $nchoices."
  exit 1
fi
