mirror of
https://github.com/kejilion/sh.git
synced 2025-08-17 20:41:11 +08:00
Update Limiting_Shut_down.sh
This commit is contained in:
parent
7800752d23
commit
7217f5edeb
1 changed files with 2 additions and 1 deletions
|
@ -2,11 +2,12 @@
|
|||
|
||||
# 获取总的接收和发送流量
|
||||
output=$(awk 'BEGIN { rx_total = 0; tx_total = 0 }
|
||||
NR > 2 { rx_total += $2; tx_total += $10 }
|
||||
$1 ~ /^(eth|ens|enp|eno)[0-9]+/ { rx_total += $2; tx_total += $10 }
|
||||
END {
|
||||
printf("%.0f Bytes %.0f Bytes", rx_total, tx_total);
|
||||
}' /proc/net/dev)
|
||||
|
||||
|
||||
# 获取接收和发送的流量数据
|
||||
rx=$(echo "$output" | awk '{print $1}')
|
||||
tx=$(echo "$output" | awk '{print $3}')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue