feat: Improve CPU detection (#144)

This commit is contained in:
Kroese 2024-10-14 18:47:24 +02:00 committed by GitHub
parent 26403222ba
commit 518b815ba2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -247,7 +247,7 @@ configureNAT() {
NET_OPTS+=",script=no,downscript=no" NET_OPTS+=",script=no,downscript=no"
! configureDNS && return 1 configureDNS || return 1
return 0 return 0
} }
@ -375,7 +375,7 @@ if [[ "$DHCP" == [Yy1]* ]]; then
fi fi
# Configure for macvtap interface # Configure for macvtap interface
! configureDHCP && exit 20 configureDHCP || exit 20
else else
@ -404,7 +404,7 @@ else
if [[ "${NETWORK,,}" == "user"* ]]; then if [[ "${NETWORK,,}" == "user"* ]]; then
# Configure for usermode networking (slirp) # Configure for usermode networking (slirp)
! configureUser && exit 24 configureUser || exit 24
fi fi

View file

@ -63,8 +63,9 @@ if [ -z "${CPU// /}" ] && grep -qi "model:" <<< "$CPI"; then
CPU=$(echo "$CPI" | grep -m 1 -i 'model:' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g') CPU=$(echo "$CPI" | grep -m 1 -i 'model:' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g')
fi fi
[ -z "${CPU// /}" ] && CPU="Unknown" CPU="${CPU// Quad core CPU/}"
CPU="${CPU// with Radeon Graphics/}" CPU="${CPU// with Radeon Graphics/}"
[ -z "${CPU// /}" ] && CPU="Unknown"
# Check system # Check system