#!/bin/sh
dialog \
--title "Select clock chip class" \
--menu "Please choose the appropriate DAC class\n\
 for your card. (current: $1)" \
21 50 10 \
\
"ATT"        "AT&T chips" \
"bt"        "Brook-Tree" \
"generic"        "generic VGA DAC" \
\
2> /tmp/.dacclass 

DAC_CLASS=$1
DAC_TYPE=$2

NEW_DAC_CLASS=`cat /tmp/.dacclass`

if [ "$NEW_DAC_CLASS" != "" ]; then
  ramdac/$NEW_DAC_CLASS/.configure $2
  NEW_DAC_TYPE=`cat /tmp/.dactype`
  if [ "$NEW_DAC_TYPE" != "" ]; then
    DAC_CLASS=$NEW_DAC_CLASS
    DAC_TYPE=$NEW_DAC_TYPE
  fi
fi

echo $DAC_CLASS>/tmp/.dacclass
echo $DAC_TYPE>/tmp/.dactype
