generic wmic cpu support

This commit is contained in:
abbie 2024-11-12 19:12:32 +00:00
parent 0e11900adb
commit 93d8341bad
Signed by: threeoh6000
GPG key ID: 801FE4AD456E922C

View file

@ -23,6 +23,11 @@ if [ "$hasawk" -eq 1 ] && [ "$system_type" = "linux" ] || [ "$system_type" = "wi
processor="$(cat /proc/cpuinfo | grep "Processor" | head -n 1 | awk -F ": " '{print $2}')" processor="$(cat /proc/cpuinfo | grep "Processor" | head -n 1 | awk -F ": " '{print $2}')"
fi fi
fi fi
if [ "$hassed" -eq 1 ] && [ "$system_type" = "windows" ] && [ -z "$processor" ]; then
if [ -n "$(wmic.exe cpu get name | sed -n 2p | head -n 1)" ]; then
processor="$(wmic.exe cpu get name | sed -n 2p | head -n 1)"
fi
fi
if [ "$hassed" -eq 1 ] && [ "$hasawk" -eq 1 ] && [ -n "$processor" ]; then if [ "$hassed" -eq 1 ] && [ "$hasawk" -eq 1 ] && [ -n "$processor" ]; then
if [ -n "$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")" ]; then if [ -n "$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")" ]; then
processor="$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")" processor="$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")"