mirror of
https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git
synced 2025-09-03 05:02:40 +02:00
Moved some configutation options to the config files Minor text changes Converted a lot of spaces to tabs
25 lines
934 B
Bash
Executable File
25 lines
934 B
Bash
Executable File
#!/bin/sh
|
|
IF=wlan0
|
|
|
|
while true
|
|
do
|
|
R1=`cat /sys/class/net/${IF}/statistics/rx_bytes`
|
|
T1=`cat /sys/class/net/${IF}/statistics/tx_bytes`
|
|
sleep 1
|
|
R2=`cat /sys/class/net/${IF}/statistics/rx_bytes`
|
|
T2=`cat /sys/class/net/${IF}/statistics/tx_bytes`
|
|
TBPS=$(($T2-$T1))
|
|
RBPS=$(($R2-$R1))
|
|
TKBPS=$(($TBPS/1024))
|
|
RKBPS=$(($RBPS/1024))
|
|
IP=`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'`
|
|
# CPU=`grep 'cpu ' /proc/stat | awk '{ printf("%.0f", ($2+$4)*100/($2+$4+$5)) }'`
|
|
CPU=`top -n 1 | grep CPU: | grep -v grep| awk '{ print $2}'`
|
|
freemem=`free | grep Mem |grep -v grep | awk '{ printf("%.0f", $4/$2 * 100.0) }'`
|
|
memtop=`top -n 1 | grep Mem: |grep -v grep | awk '{ printf("Used=%.0fk Free=%.0fk",$2,$4)}'`
|
|
string="`hostname` ${IP} tx:$TKBPS kb/s rx:$RKBPS kb/s CPU=${CPU}% FreeMem=${freemem}% ${memtop}"
|
|
# echo ".$string." >> /var/log/osd
|
|
/system/sdcard/bin/setconf -k o -v "${string}"
|
|
|
|
done
|