thanks for all the links. i was right about the head scratching
though. to get the freedb info it has to do all these steps...
get hostname and username (not hard)
cd-discid /dev/cdrom > sometempfile
cddb-tool query on that file > someothertempfile
some cleaver magic to get the genre of the album it found out of the someothertempfile but if it finds more than one entry just go for the first one and if it doesnt find any entrys for the cd throw an error or somthing
cddb-tool read using the genre we got earlier > anothertempfile
and hopefully then you will have information about the cd.
no clue how to do the bit which finds the genre from inside that text file though!
im going to bed for now , too tired to do anything this confusing