-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_lcd_temp_watts.sh
More file actions
32 lines (18 loc) · 884 Bytes
/
update_lcd_temp_watts.sh
File metadata and controls
32 lines (18 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# ----------------------------------------------------------------------------------
# Script for using ipmitool to retrieve the ambient temperature from the motherboard
# and current watts being used from the PSU and print them to the front LCD
# ----------------------------------------------------------------------------------
# Get temperature (celsius) and assign it to a variable
TEMPA=$(ipmitool sdr type temperature | grep Ambient | grep degrees | grep -Po '\d{2}' | tail -1)
echo "$TEMPA"
# Get watts used and assign to a variable
POWER=$(ipmitool sdr type current | grep Watts | grep -Po '\d{3}')
echo "$POWER"
# Convert celsius to farenheit
TEMPB=$(($TEMPA * 9 / 5 + 32))
echo "$TEMPB"
# Set LCD to user string and combine temp and power info
screen=$"("$TEMPB" F | "$POWER" W)"
echo "$screen"
ipmitool delloem lcd set mode userdefined "$screen"