Files
quectel-rgmii-toolkit/ipk-source/sdxpinn-quecmanager/root/www/cgi-bin/traffic_stats.sh
Cameron Thompson b5c7bfe567 Update Packages
- Updated QuecManager to 0.0.3 include patch from c8faf539c1

- Added LAN settings to sdxpinn-console-menu V0.0.2

- Updated Tailscale ipks from 1.74.1 to 1.76.1
2024-10-30 02:07:11 +00:00

16 lines
422 B
Bash
Executable File

#!/bin/sh
echo "Content-type: application/json"
echo ""
# Get RX and TX bytes from ifconfig eth0
data=$(ifconfig eth0 | grep "RX bytes")
# Extract download (RX) and upload (TX) values using awk
download=$(echo $data | awk '{print $2}' | cut -d':' -f2)
upload=$(echo $data | awk '{print $6}' | cut -d':' -f2)
# Return JSON response
echo "{"
echo " \"download\": \"$download\","
echo " \"upload\": \"$upload\""
echo "}"