QuecManager 1.0.2 BETA
- Added signal graphs for RSRP, RSRQ, and SINR - Added ethernet connection details - Added memory usage details - Added ping graph Known bug: Signal graphs may sometimes show inaccurate values. It seems to be a fetching error but Ill try to find the real root cause as soon as possible Co-Authored-By: Russel Yasol <73575327+dr-dolomite@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Ensure the script outputs proper CGI headers
|
||||
echo "Content-Type: application/json"
|
||||
echo ""
|
||||
|
||||
# Directory where JSON files are stored (adjust as needed)
|
||||
JSON_DIR="/tmp/signal_graphs/"
|
||||
|
||||
# Function to safely read JSON file
|
||||
read_json_file() {
|
||||
local file="$1"
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
else
|
||||
echo "[]" # Return empty array if file doesn't exist
|
||||
fi
|
||||
}
|
||||
|
||||
# Collect signal metrics from JSON files
|
||||
RSRP=$(read_json_file "${JSON_DIR}/rsrp.json")
|
||||
RSRQ=$(read_json_file "${JSON_DIR}/rsrq.json")
|
||||
SINR=$(read_json_file "${JSON_DIR}/sinr.json")
|
||||
|
||||
# Combine metrics into a single JSON object
|
||||
printf '{
|
||||
"rsrp": %s,
|
||||
"rsrq": %s,
|
||||
"sinr": %s
|
||||
}' "$RSRP" "$RSRQ" "$SINR"
|
||||
Reference in New Issue
Block a user