From 1d6e4376d59bb7bf6b8c1881dc42baf81ae31f7a Mon Sep 17 00:00:00 2001 From: zeus Date: Mon, 11 Jan 2021 20:36:52 +0200 Subject: [PATCH] status --- files/status-1.sh | 16 ++++++++++++++++ files/status.sh | 12 +++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 files/status-1.sh 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 - [[ $(