#!/bin/sh
dialog \
--title "Select chipset class" \
--menu "Please choose the appropriate chipset for \nyour card. (current: $1)" \
21 60 10 \
\
"ATI"		"ATI Inc. (DO NOT WORK)" \
"Chips"		"Chips & Technologies notebook chips" \
"Cirrus"	"Cirrus Logic chipsets" \
"Hercules"	"Hercules chipsets (inc. HGC)" \
"IBM"		"IBM chipsets (inc. VGA)" \
"Matrox"	"Matrox chipsets" \
"S3"		"S3 Incorporated chipsets" \
"Tseng"		"Tseng Laboratories chipsets" \
\
2> /tmp/.chipclass 

CHIP_CLASS=$1
CHIP_TYPE=$2

NEW_CHIP_CLASS=`cat /tmp/.chipclass`

if [ "$NEW_CHIP_CLASS" != "" ]; then
  if [ "$NEW_CHIP_CLASS" = "$CHIP_CLASS" ]; then 
    chipset/$NEW_CHIP_CLASS/.configure $2;
   else
    chipset/$NEW_CHIP_CLASS/.configure;
  fi
  NEW_CHIP_TYPE=`cat /tmp/.chiptype`
  if [ "$NEW_CHIP_TYPE" != "" ]; then
    CHIP_CLASS=$NEW_CHIP_CLASS
    CHIP_TYPE=$NEW_CHIP_TYPE
  fi
fi

echo $CHIP_CLASS>/tmp/.chipclass
echo $CHIP_TYPE>/tmp/.chiptype
