Fixed it with the following code:
#!/bin/bash
ceol=`tput el`;
manu=`dmidecode -s system-manufacturer`;
dots "Identifying hardware"
case $manu in
[Ll][Ee][Nn][Oo][Vv][Oo])
machine=$(dmidecode -s system-version)
;;
*I[Nn][Tt][Ee][Ll]*)
# baseboard-product-name
machine=$(dmidecode -s baseboard-product-name)
;;
*)
# system-product-name
machine=$(dmidecode -s system-product-name)
;;
esac