#!/bin/bash


# Detect hardware
cpu="Generic"
ccpu=$(grep "model name" -m 1 /proc/cpuinfo | awk -F ': ' '{print $2}')
if [ "$ccpu" = "Intel(R) Celeron(R) J6412 @ 2.00GHz" ]; then
	cpu="J6412"
elif [ "$ccpu" = "Intel(R) Celeron(R) CPU  N2930  @ 1.83GHz" ]; then 
	cpu="N2930"
elif [ "$ccpu" = "Intel(R) Celeron(R) CPU  J1900  @ 1.99GHz" ]; then 
	cpu="J1900"
elif [ "$ccpu" = "Intel(R) Celeron(R) CPU  U1900  @ 1.99GHz" ]; then 
	cpu="U1900"
elif [ "$ccpu" = "Intel(R) Atom(TM) CPU N2600   @ 1.60GHz" ]; then
	cpu="N2600"
else
	grep -q "CPU N270   @ 1.60GHz" /proc/cpuinfo
	if [ $? -eq 0 ]; then
		cpu="N270"
	else
		grep -q "Intel(R) Atom(TM) CPU  330   @ 1.60GHz" /proc/cpuinfo
		if [ $? -eq 0 ]; then
			cpu="330"
		else
			echo $cpu
			exit -1
		fi
	fi
fi

echo $cpu
exit 0
