#!/bin/sh
#----------------------------------------------------------------------------
# Name..........: cputemp.sh
# Version.......: 0.1
# Description...: Convert Sensor Data From Celcius to Farenheit (C2F).
# Target OS.....: Linux
# Requires......: /bin/sh
# Last Modified.: 2008y08m01d
# Author........: Sean Blankenship <spcsys@gmail.com>
# Copyright.....: Copyright © 2006 Specialized Systems. All rights reserved.
# Notes.........: None.
#----------------------------------------------------------------------------
# variables
  PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"; export PATH
#
#----------------------------------------------------------------------------
function c2f() {
	# round number up or down
	#for n in $(printf %.0f $1); do
	#	x=$n
	#done
	x=$(printf %.0f $1)
	let c="$x*9/5+32"
	c2f=$c ;return
}
#----------------------------------------------------------------------------
cpuf=$(cat /proc/cobalt/sensors/thermal|awk -F: '{ print $2 }')
#c2f $cpuf && logger "CPU Temp: ${cpuf}C / ${c2f}F"
 c2f $cpuf && echo   "CPU Temp: ${cpuf}C / ${c2f}F"
exit 0


# echo equation | bc
# let "months = $term - 1"
# echo $((5+12))
# F=(C x 9/5)+32
# C=(F-32) x 5/9
