mirror of
https://dev.iopsys.eu/system/sysmngr.git
synced 2026-03-14 21:20:18 +01:00
remove dependency on temperature.sh
This commit is contained in:
parent
7c7d9c9166
commit
9563003ca1
2 changed files with 1 additions and 57 deletions
|
|
@ -296,7 +296,7 @@ DMOBJ tDeviceInfoObj[] = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SYSMNGR_TEMPERATURE_STATUS
|
#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
|
#endif
|
||||||
|
|
||||||
#ifdef SYSMNGR_VENDOR_EXTENSIONS
|
#ifdef SYSMNGR_VENDOR_EXTENSIONS
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
Loading…
Add table
Reference in a new issue