#!/bin/bash
# this script basically asks the user, if he is happy with the hardware-support of the currently running linux
# it then writes this to a log file in the format of ~/hardware_support/MotherBoardManufacturer/MotherBoardLevel.txt

cd ~;
mkdir hardware_supported;
cd hardware_supported;

# create folder for every brand/vendor
MOBOMANUFACTURER=$(dmidecode -s "baseboard-manufacturer")
mkdir "$MOBOMANUFACTURER";
cd "$MOBOMANUFACTURER";

echo "============ MOBOMANUFACTURER": $MOBOMANUFACTURER;

PS3='How well is your hardware supported?'
WELLNESS="none";
options=("very_well" "okay" "not_good" "Quit")
select opt in "${options[@]}"
do
    case $opt in
        "very_well")
        WELLNESS="very_well";
        mkdir very_well;
        cd very_well;
        break;
            ;;
        "okay")
        WELLNESS="okay";
        mkdir okay;
        cd okay;
        break;
            ;;
        "not_good")
        WELLNESS="not_good";
        mkdir not_good;
        cd not_good;
        break;
            ;;
        "Quit")
            break
            ;;
        *) echo invalid option;;
    esac
done

PS3='Are you happy with the working-speed?'
SPEED="none";
options=("very_well" "okay" "not_good" "Quit")
select opt in "${options[@]}"
do
    case $opt in
        "very_well")
                SPEED="very_well";
                break;
            ;;
        "okay")
                SPEED="okay";
                break;
            ;;
        "not_good")
                SPEED="not_good";
                break;
            ;;
        "Quit")
            break
            ;;
        *) echo invalid option;;
    esac
done

MOBOMODEL=$(dmidecode -s "baseboard-product-name");
PRODUCTNAME=$(dmidecode -s "system-product-name");

FILENAME=$MOBOMODEL_$PRODUCTNAME.txt; # add .txt extension to filename

echo "FILENAME: ""$FILENAME";

echo "======== MOTHERBOARD MODEL" >> "$FILENAME";
echo $MOBOMODEL >> "$FILENAME";

echo "======== PRODUCTNAME" >> "$FILENAME";

echo $PRODUCTNAME >> "$FILENAME";

echo "======== HAPPYNESS WITH HARDWARE SUPPORT" >> "$FILENAME";
echo $WELLNESS >> "$FILENAME";

echo "======== OS VERSION AND KERNEL" >> "$FILENAME";
echo $(uname -a) >> "$FILENAME";
cat /etc/debian_version >> "$FILENAME";

echo "======== WORKING-SPEED" >> "$FILENAME";
echo $SPEED >> "$FILENAME";

echo "======== ANY COMMENTS?" >> "$FILENAME";
read -e -p "======== ANY COMMENTS?" COMMENT;
echo $COMMENT >> "$FILENAME";

DATE=$(date +%Y-%m-%d)
echo "======== DATE" $DATE >> "$FILENAME";

echo "======== lscpu" >> "$FILENAME";
lscpu >> "$FILENAME";

echo "======== lspci" >> "$FILENAME";
lspci >> "$FILENAME";

Leave a Reply

Your email address will not be published. Required fields are marked *