From 8ab7de56c035c1124fb9a87cd033b5deb091557b Mon Sep 17 00:00:00 2001 From: Sledge Sulaweyo Date: Wed, 18 Apr 2018 15:00:15 +0200 Subject: [PATCH] Update kvm-probes.d/cpu.sh to deal with PowerPC CPUs (/proc/cpuinfo) --- src/im_mad/remotes/kvm-probes.d/cpu.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/im_mad/remotes/kvm-probes.d/cpu.sh b/src/im_mad/remotes/kvm-probes.d/cpu.sh index 8d094f7e34..7e1f23ab90 100755 --- a/src/im_mad/remotes/kvm-probes.d/cpu.sh +++ b/src/im_mad/remotes/kvm-probes.d/cpu.sh @@ -16,10 +16,20 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +MODEL='' + if [ -f /proc/cpuinfo ]; then + for NAME in 'model name' 'cpu'; do + MODEL=$(grep -m1 "^${NAME}[[:space:]]*:" /proc/cpuinfo | \ + cut -d: -f2 | \ + sed -e 's/^ *//') - echo -n "MODELNAME=\"" - grep -m 1 "model name" /proc/cpuinfo | cut -d: -f2 | sed -e 's/^ *//' | sed -e 's/$/"/' - + if [ -n "${MODEL}" ]; then + break + fi + done fi +if [ -n "${MODEL}" ]; then + echo "MODELNAME=\"${MODEL}\"" +fi