43 lines
1.2 KiB
Bash
43 lines
1.2 KiB
Bash
#!/bin/bash
|
|
# ___ _ _ _ __
|
|
# / __|| |_ | |_ ___ | '_ \ ___
|
|
# \__ \| _|| \ / _ \| .__// -_)
|
|
# |___/ \__||_||_|\___/|_| \___|
|
|
|
|
## USAGE:
|
|
# clear;bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/raw/branch/master/custom-cmds-in-ubuntu/bin_examples/get_pc_details.sh)"
|
|
|
|
DF=details_$HOSTNAME.log
|
|
|
|
dpkg -s dmidecode &> /dev/null
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo "[$HOSTNAME bios]" >> $DF
|
|
sudo dmidecode --type bios >> $DF
|
|
|
|
echo "[$HOSTNAME system]" >> $DF
|
|
sudo dmidecode --type system >> $DF
|
|
|
|
echo "[$HOSTNAME baseboard]" >> $DF
|
|
sudo dmidecode --type baseboard >> $DF
|
|
|
|
echo "[$HOSTNAME chassis]" >> $DF
|
|
sudo dmidecode --type chassis >> $DF
|
|
|
|
echo "[$HOSTNAME processor]" >> $DF
|
|
sudo dmidecode --type processor >> $DF
|
|
|
|
echo "[$HOSTNAME memory]" >> $DF
|
|
sudo dmidecode --type memory >> $DF
|
|
|
|
echo "[$HOSTNAME cache]" >> $DF
|
|
sudo dmidecode --type cache >> $DF
|
|
|
|
echo "[$HOSTNAME connector]" >> $DF
|
|
sudo dmidecode --type connector >> $DF
|
|
|
|
echo "[$HOSTNAME slot]" >> $DF
|
|
sudo dmidecode --type slot >> $DF
|
|
else
|
|
sudo apt-get -qq update;sudo apt-get -qq install -y dmidecode
|
|
fi |