Use js4jiang5's implementation of smc_read_hex() to fix smc output parsing error

This commit is contained in:
user
2025-10-04 01:05:47 +02:00
parent 0e5b7b04d7
commit 49f5daaa45

View File

@@ -194,10 +194,13 @@ function detect_smc_capabilities() {
}
function smc_read_hex() {
local key=$1
local value=$(sudo -n smc -k "$key" -r 2>/dev/null | awk '{print $4}')
value=${value//:/}
echo "$value"
key=$1
line=$(echo $(smc -k $key -r))
if [[ $line =~ "no data" ]]; then
echo
else
echo ${line#*bytes} | tr -d ' ' | tr -d ')'
fi
}
function smc_write_hex() {