Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions LinuxHardwareDetection
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ fi
#######GLOBALVARS#######
export log=/$HOME/Desktop/linux-check.log

########################
date >> $log
echo -e "\nSystem Report\n------------------" >> $log

#######FUNCTIONS#######
checkRAM(){
RAM=$(free -m | awk '/^Mem:/{print $2}')
Expand All @@ -34,12 +30,12 @@ checkRAM(){
checkDev(){
echo -e "Present Devices\n-------------------"
drives=( '/dev/cd*' '/dev/dvd*' '/dev/usb*' )
for i in "${drives[@]}"
for drive in "${drives[@]}"
do
if ls $i 1>/dev/null
then echo "${i}: Present"
then echo "${drive}: Present"
else
echo "${i}: Not present"
echo "${drive}: Not present"
fi
done
}
Expand All @@ -57,7 +53,7 @@ getHardInfo(){
audio=$(lspci | cut -f2- -d ' ' | awk '/[Aa]udio/'
)
echo -e "${serial}\n\nCPU:\n${processor}\n\n${drives}\nOptical drives: ${opticals}\n\nUSB ports:\n${usb}\n\n${network}\n${graphics}\n${audio}\n"

}

getSoftInfo(){
Expand All @@ -68,14 +64,15 @@ getSoftInfo(){
}

#######EXECUTION#######

date >> "{$log}"
echo -e "\nSystem Report\n------------------" >> "{$log}"
echo -e "\nGenerating system report..."
checkRAM >> $log 2>&1
checkRAM >> "{$log}" 2>&1
echo "Checking devices..."
checkDev >> $log 2>&1
checkDev >> "{$log}" 2>&1
echo "Checking avalible hardware devices..."
getHardInfo >> $log 2>&1
getHardInfo >> "{$log}" 2>&1
echo "Checking software configuration..."
getSoftInfo >> $log 2>&1
getSoftInfo >> "{$log}" 2>&1
echo -e "All Finished! Check ${log} for details.\n"
cat $log
cat "{$log}"