#!/bin/sh

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

case $(dtsoc) in
  amlogic,g12* | amlogic,sm1)
    TEMP=$(cat /sys/devices/virtual/thermal/thermal_zone1/temp)
    ;;
  *)
    TEMP=$(cat /sys/class/hwmon/hwmon0/temp1_input)
    ;;
esac

TEMP="$(($TEMP / 1000))"
echo "${TEMP} C"
