Install LSIUtil from here:
Use this to get the temperature:
#!/bin/sh
lsiutil="/path/to/lsiutil"
"$lsiutil" -p1 -a 25,2,0,0 | awk '/IOCTemperature: /{print strtonum($2)" C"}'
Explanation here:
If you’re hesitant to use the binaries, create a jlmkr container and compile from source.