diff --git a/files/status-1.sh b/files/status-1.sh new file mode 100755 index 0000000..d4931b7 --- /dev/null +++ b/files/status-1.sh @@ -0,0 +1,16 @@ + +#!/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 + + diff --git a/files/status.sh b/files/status.sh index 5df1158..42196d6 100644 --- a/files/status.sh +++ b/files/status.sh @@ -4,7 +4,17 @@ function ifup { if [[ ! -d /sys/class/net/${1} ]]; then return 1 else - [[ $(