mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
Refactor get DMI function
This commit is contained in:
parent
33135b6bcd
commit
d9919fd1da
@ -68,7 +68,7 @@ SMALLNUM="$(readConfigKey "smallnum" "${USER_CONFIG_FILE}")"
|
||||
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
|
||||
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
|
||||
|
||||
DMI="$(dmesg 2>/dev/null | grep -i "DMI:" | sed 's/\[.*\] DMI: //i')"
|
||||
DMI="$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')"
|
||||
CPU="$(echo $(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}'))"
|
||||
MEM="$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo 2>/dev/null) MB"
|
||||
|
||||
|
@ -166,7 +166,7 @@ function modelMenu() {
|
||||
fi
|
||||
# If user change model, clean build* and pat* and SN
|
||||
if [ "${MODEL}" != "${resp}" ]; then
|
||||
PLATFORM="$(grep -w "${resp}" "${TMP_PATH}/modellist" | awk '{print $2}' | head -n 1)"
|
||||
PLATFORM="$(grep -w "${resp}" "${TMP_PATH}/modellist" | awk '{print $2}' | head -1)"
|
||||
MODEL="${resp}"
|
||||
writeConfigKey "platform" "${PLATFORM}" "${USER_CONFIG_FILE}"
|
||||
writeConfigKey "model" "${MODEL}" "${USER_CONFIG_FILE}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user