From 46af34c59cdf7ef717ccc0801ab15f45f1de62d6 Mon Sep 17 00:00:00 2001 From: bol-van Date: Thu, 9 Dec 2021 20:13:38 +0300 Subject: [PATCH] blockcheck: fix sleep --- blockcheck.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/blockcheck.sh b/blockcheck.sh index 9f644a5..eec7479 100755 --- a/blockcheck.sh +++ b/blockcheck.sh @@ -109,7 +109,7 @@ check_system() local UNAME=$(uname) [ "$UNAME" = "Linux" ] || { - echo not supported + echo $UNAME not supported exitp 5 } } @@ -199,10 +199,14 @@ tpws_ipt_unprepare() nfqws_start() { "$NFQWS" --dpi-desync-fwmark=$DESYNC_MARK --qnum=$QNUM "$@" >/dev/null & + PID=$! } tpws_start() { "$TPWS" --uid $TPWS_UID:$TPWS_UID --bind-addr=$LOCALHOST --port=$TPPORT "$@" >/dev/null & + PID=$! + # give some time to initialize + sleep 1 } curl_test() @@ -227,17 +231,15 @@ ws_curl_test() # $2 - test function # $3 - domain # $4,$5,$6, ... - ws params - local code pid ws_start=$1 testf=$2 dom=$3 + local code ws_start=$1 testf=$2 dom=$3 shift shift shift $ws_start "$@" - pid=$! # let some time for tpws to initialize -sleep 1 curl_test $testf $dom code=$? - killwait -9 $pid + killwait -9 $PID return $code } tpws_curl_test()