Created
October 29, 2022 20:54
-
-
Save dmd/227f380e39a752e88bb44a286731a888 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update the temperature database | |
# I don't use netcat because I'm a real man and don't | |
# rely on external tools, especially not ones that take | |
# a WHOLE SECOND to time out before they return. | |
rrdtool update /var/log/imt/temperature.rrd N:$( | |
exec 3<>/dev/tcp/localhost/imtuc | |
echo "r dist_temp | |
r pc_temp | |
r pl_reg_temp | |
r sam1_temp | |
r sam2_temp | |
r sam3_temp | |
r sam4_temp" >&3 | |
(sed 7q <&3) | | |
awk '{print $3}' | | |
sed 's/NA/U/' | | |
tr '\n' ':' | sed 's/.$//' | |
exec 3>&- ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment