#!/usr/bin/env sh #Modify this to point to your temperature probe dir=/sys/bus/w1/devices/[some-hexadecimals] # DO NOT MODIFY # Sanity check which bc 2>&1 >/dev/null || { echo "PROBE ERROR: 'bc' not found. Please install bc." >&2; exit 1; } # Retrieve temperature in Celsius raw=$(grep 't=' $dir/w1_slave | awk -F'=' '{print $2}') echo "scale=3; ${raw}/1000" | bc -l && exit 0 exit 1