From 93d8341bad7aadfc290a50131797c55bfb17d5b5 Mon Sep 17 00:00:00 2001 From: threeoh6000 Date: Tue, 12 Nov 2024 19:12:32 +0000 Subject: [PATCH] generic wmic cpu support --- processor_detection.4 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/processor_detection.4 b/processor_detection.4 index 57d299d..da9927b 100644 --- a/processor_detection.4 +++ b/processor_detection.4 @@ -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}')" 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 [ -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 " ")"