#!/bin/sh
if [ "x$1" = "xCPU" ]; then
OUT=$(sensors | sed -n 's/^CPU Temperature:\s*+\(.*\)°C\s*(\(.*\)/\1/p')
elif [ "x$1" = "xMB" ]; then
OUT=$(sensors | sed -n 's/^MB Temperature:\s*+\(.*\)°C\s*(\(.*\)/\1/p')
else
exit 1
fi
if [ $OUT -ge 60 ]; then
echo "$OUT°C"
elif [ $OUT -ge 67 ]; then
echo "$OUT°C"
elif [ $OUT -ge 75 ]; then
echo "$OUT°C"
else
echo "$OUT°C"
fi