Build sdxpinn-quecmanger ipk
-Removed no longer needed files -Created ipk for quecmanager -Thank you @dr-dolomite for your hard work on this! Co-Authored-By: Russel Yasol <73575327+dr-dolomite@users.noreply.github.com>
This commit is contained in:
16
ipk-source/sdxpinn-quecmanager/root/www/cgi-bin/home/traffic_stats.sh
Executable file
16
ipk-source/sdxpinn-quecmanager/root/www/cgi-bin/home/traffic_stats.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/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 "}"
|
||||
Reference in New Issue
Block a user