Add 'custom-cmds-in-ubuntu/bin_examples/get_pc_details.sh'

This commit is contained in:
sthope 2021-11-13 18:29:59 +01:00
parent 48160eccb6
commit 28038dfe06

View File

@ -0,0 +1,43 @@
#!/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