You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
233 B

#!/bin/bash
net=wg0
test_time=2
T1=$(cat /sys/class/net/$net/statistics/tx_bytes)
sleep $test_time
T2=$(cat /sys/class/net/$net/statistics/tx_bytes)
#echo "t2=$T2 t1=$T1"
tot=$(( (T2 - T1)))
if [ $tot -eq 0 ]; then
echo "1"
fi