#!/bin/sh

# Script to print current temperature readings for SS AP

AP_PLATFORM=`cat /COOKIE_PID`
if [ ! -z "$AP_PLATFORM" ]; then
    case $AP_PLATFORM in
         *9115*|*1900*)
                # Salt-Spring
                f1="/sys/bus/i2c/devices/0-004f/hwmon/hwmon0/temp1_input"
                f2="/sys/class/thermal/thermal_zone0/temp"
                #
                # Print temperatures
                #
                read t1 < $f1
                echo "Remote sensor temperature = $((t1/1000)) C"
                read t2 <$f2
                echo "BCM49408 CPU temperature = $((t2/1000)) C"
                ;;
         *)
            echo "Unknown AP type"
            ;;
        esac
fi


