mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Allwinner: Replace bc with awk for floating-point comparison in temperature check
This commit is contained in:
@@ -11,11 +11,11 @@
|
||||
function getboardtemp() {
|
||||
if [ -f /etc/armbianmonitor/datasources/soctemp ]; then
|
||||
read raw_temp </etc/armbianmonitor/datasources/soctemp 2>/dev/null
|
||||
if [ ! -z $(echo "$raw_temp" | grep -o "^[1-9][0-9]*\.\?[0-9]*$") ] && (( $(echo "${raw_temp} < 200" |bc -l) )); then
|
||||
if [[ "$raw_temp" =~ ^[1-9][0-9]*\.?[0-9]*$ ]] && awk "BEGIN {exit !($raw_temp < 200)}"; then
|
||||
# Allwinner legacy kernels output degree C
|
||||
board_temp=${raw_temp}
|
||||
else
|
||||
board_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp})
|
||||
board_temp=$(awk '{printf("%d",$1/1000)}' <<<"${raw_temp}")
|
||||
fi
|
||||
elif [ -f /etc/armbianmonitor/datasources/pmictemp ]; then
|
||||
# fallback to PMIC temperature
|
||||
|
||||
Reference in New Issue
Block a user