Skip to content

Commit

Permalink
feat: Improve CPU detection (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Oct 14, 2024
1 parent 2640322 commit 518b815
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ configureNAT() {

NET_OPTS+=",script=no,downscript=no"

! configureDNS && return 1
configureDNS || return 1

return 0
}
Expand Down Expand Up @@ -375,7 +375,7 @@ if [[ "$DHCP" == [Yy1]* ]]; then
fi

# Configure for macvtap interface
! configureDHCP && exit 20
configureDHCP || exit 20

else

Expand Down Expand Up @@ -404,7 +404,7 @@ else
if [[ "${NETWORK,,}" == "user"* ]]; then

# Configure for usermode networking (slirp)
! configureUser && exit 24
configureUser || exit 24

fi

Expand Down
3 changes: 2 additions & 1 deletion src/reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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')
fi

[ -z "${CPU// /}" ] && CPU="Unknown"
CPU="${CPU// Quad core CPU/}"
CPU="${CPU// with Radeon Graphics/}"
[ -z "${CPU// /}" ] && CPU="Unknown"

# Check system

Expand Down

0 comments on commit 518b815

Please sign in to comment.