8

How to test whether Linux is running on a ThinkPad?

view full story
linux-howto

http://unix.stackexchange.com – I need to programmatically detect if Linux is running on a ThinkPad. A shell script would be ideal but I can programmatically generate any binary by downloading some source and compiling it on the machine if only a custom program will be able to reliably do that. Focus is: reliability/accuracy. If in doubt, I prefer not to run the script. I have a hunch this may be cleverly done using text parsing of things like dmesg or lshw, but which method is the most reliable? Restriction: run as a normal user, as part of a login script, no possibility of temporarily elevating privileges just to detec (HowTos)