Changed OpenBSD temperature extraction from grep/cut to awk

This commit is contained in:
rage311 2018-01-17 12:52:24 -07:00
parent 840a653458
commit c9f910f526

View file

@ -1086,9 +1086,8 @@ get_cpu() {
deg="${deg/C}"
;;
"OpenBSD"* | "Bitrig"*)
deg_var="$(sysctl hw.sensors | grep -m1 -E 'lm0.temp0|cpu0.temp0' | cut -d'=' -f1)"
deg="$(sysctl -n $deg_var)"
deg="${deg/0 degC}"
deg="$(sysctl hw.sensors | awk -F '=| degC' '/lm0.temp|cpu0.temp/ {print $2; exit}')"
deg="${deg/00/0}"
;;
esac
;;