mirror of
https://github.com/AlexMacocian/ServerManagementUtils.git
synced 2026-07-15 15:19:58 +00:00
16 lines
463 B
Bash
16 lines
463 B
Bash
#!/bin/bash
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
. "${SCRIPT_DIR}/../share/logging.sh"
|
|
|
|
LOGFILE=/var/log/temperature.log
|
|
touch "$LOGFILE"
|
|
chmod 644 "$LOGFILE"
|
|
|
|
for i in {1..6}; do
|
|
timestamp=$(GetTimestamp)
|
|
paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C/' | while read line; do
|
|
echo "$timestamp $line" >> "$LOGFILE"
|
|
done
|
|
sleep 10
|
|
done |