21 lines
892 B
Bash
Executable File
21 lines
892 B
Bash
Executable File
#!/bin/sh
|
|
# report hardware information
|
|
# requires dmidecode
|
|
|
|
dmidecode=`which dmidecode`
|
|
|
|
if [ $? -eq 0 ]
|
|
then
|
|
# Check if we can read from /dev/mem. The command should not be:
|
|
# head: cannot open `/dev/mem' for reading: Operation not permitted
|
|
# This is a problem on virtual instances.
|
|
# if [ `head -c1 /dev/mem 2>&1 | awk '{print $1}'` -eq 'head:' ]
|
|
# then
|
|
echo '<<<dmi>>>'
|
|
for FIELD in bios-vendor bios-version bios-release-date system-manufacturer system-product-name system-version system-serial-number system-uuid baseboard-manufacturer baseboard-product-name baseboard-version baseboard-serial-number baseboard-asset-tag chassis-manufacturer chassis-type chassis-version chassis-serial-number chassis-asset-tag processor-family processor-manufacturer processor-version processor-frequency
|
|
do
|
|
echo $FIELD=$($dmidecode -s $FIELD|grep -v ^\#)
|
|
done
|
|
# fi
|
|
fi
|