I'd take a look at the perl script memconf and see how it works. Even
though it was written for Solaris, it does a decent job on Linux. It
does like to be run as root, however.
http://www.4schmidts.com/unix.html
There is a package lshw on Fedora (among others) you could look at the
source.
decode-dimms, a perl script in lm-sensors, is another good source. It
also wants to be run as root, and requires eeprom to be loaded.
Jerry Natowitz
===> j.natowitz (at) gmail.com
On 11/02/12 13:09, Scott Ehrlich wrote:
If I wanted to write a script to obtain distro flavor (Ubuntu, CentOS,
RH, Mint, BSD, Solaris, etc), major/minor version (5.3, 10.6, etc),
hardware brand/make/model, at least for starters, what would be the
best way to attack it?
This script may or may not assume being run as root.
Environment is completely heterogeneous, so while I may be using an
OEM system, my officemate might be using a white box system.
I think the only assurance might be it be run as /bin/sh so we don't
have to worry about shells.
We cannot assume /etc/motd, /etc/issue, or anything else exists in its
out-of-box state (they could have been replaced with other text).
I thought about uname -a, but it does not indicate OS distro nor
version. Arch can only assist with 32/64 bit.
Thanks for leads and ideas.
Scott
_______________________________________________
Discuss mailing list
[email protected]
http://lists.blu.org/mailman/listinfo/discuss
_______________________________________________
Discuss mailing list
[email protected]
http://lists.blu.org/mailman/listinfo/discuss