From 37688981c4b21357cce5ffec3a8996cf726509e2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 27 Jan 2013 19:40:42 +0000 Subject: [PATCH] Switch `psrinfo` with `kstat` which is less error prone when parsing. --- bootstrap-salt-minion.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt-minion.sh b/bootstrap-salt-minion.sh index 81e9bff..549bf94 100755 --- a/bootstrap-salt-minion.sh +++ b/bootstrap-salt-minion.sh @@ -226,11 +226,11 @@ exec 2>$LOGPIPE __gather_hardware_info() { if [ -f /proc/cpuinfo ]; then CPU_VENDOR_ID=$(cat /proc/cpuinfo | grep -E 'vendor_id|Processor' | head -n 1 | awk '{print $3}' | cut -d '-' -f1 ) - elif [ -f /usr/sbin/psrinfo ]; then + elif [ -f /usr/bin/kstat ]; then # SmartOS. # Solaris!? # This has only been tested for a GenuineIntel CPU - CPU_VENDOR_ID=$( /usr/sbin/psrinfo -pv 0 | tail -n 2 | head -n 1 | cut -d ' ' -f6 | sed 's/[^A-Za-z0-9]//g' ) + CPU_VENDOR_ID=$(/usr/bin/kstat -p cpu_info:0:cpu_info0:vendor_id | awk '{print $2}') else CPU_VENDOR_ID=$( sysctl -n hw.model ) fi