14 lines
309 B
Bash
Executable File
14 lines
309 B
Bash
Executable File
#!/bin/bash
|
|
|
|
CPUTEMP=$(cat /sys/class/hwmon/hwmon3/temp1_input)
|
|
CRITEMP=70
|
|
let "REZ=$CPUTEMP / 1000"
|
|
if [ $REZ -ge $CRITEMP ]; then
|
|
JSON_FMT='{"text":"%s","class":"%s","tooltip": "cpu"}\n'
|
|
printf "$JSON_FMT" "$REZ" "crit"
|
|
else
|
|
JSON_FMT='{"text":"%s","tooltip": "cpu"}\n'
|
|
printf "$JSON_FMT" "$REZ"
|
|
fi
|
|
|