#!/bin/sh

choices () {
    echo 'mediawiki MediaWiki'
    echo 'wordpress WordPress'
    echo 'gallery2 Gallery2'
    echo 'phpbb phpBB'
    echo 'trac Trac'
    echo 'turbogears TurboGears'
    echo 'django Django'
    echo 'rails Ruby on Rails'
}

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
