mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Switch psrinfo
with kstat
which is less error prone when parsing.
This commit is contained in:
parent
abdb063f54
commit
37688981c4
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue