mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-11-07 07:09:46 +00:00
Update helper.sh
This commit is contained in:
parent
a68a4d91e2
commit
c4a72185cc
@ -386,42 +386,3 @@ CheckServiceStatus(){
|
|||||||
UDEVILUmount(){
|
UDEVILUmount(){
|
||||||
$sudo_cmd udevil umount -f $1
|
$sudo_cmd udevil umount -f $1
|
||||||
}
|
}
|
||||||
|
|
||||||
GetTemp(){
|
|
||||||
if(file_exists("/sys/class/thermal/thermal_zone0/temp"))
|
|
||||||
{
|
|
||||||
$output = rtrim(file_get_contents("/sys/class/thermal/thermal_zone0/temp"));
|
|
||||||
}
|
|
||||||
elseif (file_exists("/sys/class/hwmon/hwmon0/temp1_input"))
|
|
||||||
{
|
|
||||||
$output = rtrim(file_get_contents("/sys/class/hwmon/hwmon0/temp1_input"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$output = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(is_numeric($output))
|
|
||||||
{
|
|
||||||
$celsius = intval($output);
|
|
||||||
|
|
||||||
if($celsius > 1000) {
|
|
||||||
$celsius *= 1e-3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($setupVars['TEMPERATURE_LIMIT']))
|
|
||||||
{
|
|
||||||
$temperaturelimit = intval($setupVars['TEMPERATURE_LIMIT']);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$temperaturelimit = 60;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Nothing can be colder than -273.15 degree Celsius (= 0 Kelvin)
|
|
||||||
// This is the minimum temperature possible (AKA absolute zero)
|
|
||||||
$celsius = -273.16;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user