Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 98b883a

Browse files
committed
Added temperature script
1 parent 0010e5b commit 98b883a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/get-temperature.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
TEMP_FILE=/sys/class/thermal/thermal_zone0/temp
4+
5+
ORIGINAL_TEMP=$(cat $TEMP_FILE)
6+
TEMP_C=$((ORIGINAL_TEMP/1000))
7+
TEMP_F=$(($TEMP_C * 9/5 + 32))
8+
9+
echo $TEMP_F F
10+

0 commit comments

Comments
 (0)