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:
20
ipk-source/sdxpinn-quecmanager-beta/root/www/cgi-bin/home/ethtool.sh
Executable file
20
ipk-source/sdxpinn-quecmanager-beta/root/www/cgi-bin/home/ethtool.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Set the content type to JSON
|
||||
echo "Content-Type: application/json"
|
||||
echo ""
|
||||
|
||||
# Run ethtool on eth0 and capture the output
|
||||
ethtool_output=$(ethtool eth0)
|
||||
|
||||
# Extract Link Speed
|
||||
speed=$(echo "$ethtool_output" | grep "Speed:" | awk '{print $2}')
|
||||
|
||||
# Extract Link Status
|
||||
link_status=$(echo "$ethtool_output" | grep "Link detected:" | awk '{print $3}')
|
||||
|
||||
# Extract Auto-negotiation status
|
||||
auto_negotiation=$(echo "$ethtool_output" | grep "Auto-negotiation:" | awk '{print $2}')
|
||||
|
||||
# Create JSON output
|
||||
echo "{\"link_speed\": \"$speed\", \"link_status\": \"$link_status\", \"auto_negotiation\": \"$auto_negotiation\"}"
|
||||
Reference in New Issue
Block a user