remove dependency on temperature.sh

This commit is contained in:
Vivek Kumar Dutta 2025-12-02 13:41:23 +05:30
parent 7c7d9c9166
commit 9563003ca1
No known key found for this signature in database
GPG key ID: 4E09F5AD8265FD4C
2 changed files with 1 additions and 57 deletions

View file

@ -296,7 +296,7 @@ DMOBJ tDeviceInfoObj[] = {
#endif
#ifdef SYSMNGR_TEMPERATURE_STATUS
{"TemperatureStatus", &DMREAD, NULL, NULL, "file:/etc/sysmngr/temperature.sh", NULL, NULL, NULL, tDeviceInfoTemperatureStatusObj, tDeviceInfoTemperatureStatusParams, NULL, BBFDM_BOTH},
{"TemperatureStatus", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDeviceInfoTemperatureStatusObj, tDeviceInfoTemperatureStatusParams, NULL, BBFDM_BOTH},
#endif
#ifdef SYSMNGR_VENDOR_EXTENSIONS

View file

@ -1,56 +0,0 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/functions.sh
function get_wlan_temperature()
{
:
}
function get_sfp_temperature()
{
json_add_object
json_add_string "name" "sfp"
json_add_int "temperature" "-274"
json_close_object
}
function get_cpu_temperature()
{
json_add_object
json_add_string "name" "cpu"
json_add_int "temperature" "-274"
json_close_object
}
function get_temperature_status()
{
local hasWifi="$(db -q get hw.board.hasWifi)"
local hasSfp="$(db -q get hw.board.hasSfp)"
json_init
json_add_array "status"
get_cpu_temperature
[ "$hasSfp" = "1" ] && get_sfp_temperature
[ "$hasWifi" = "1" ] && get_wlan_temperature
json_close_array
json_dump
}
function dump_invalid()
{
json_init
json_add_string "fault" "invalid request"
json_dump
}
case "$1" in
status)
get_temperature_status
;;
*)
dump_invalid
;;
esac