Shashank D ***@***.***> writes:

>> Hmm, good question. So you're just running ss in a busy loop, or did you 
>> keep the 'sleep'? If so, that seems a bit excessive to do by default. 
> Yes I did keep the sleep in the loop. Here's the full loop:
> ```bash
> command_string=$(cat <<EOF
> duration="$(echo "$count*$interval" | bc) sec";
> endtime=\$(date -d "\$duration" +%s%N);
> while (( \$(date +%s%N) <= \$endtime )); do
>     ss -t -i -p -n state connected "dst $target $filter"
>     echo ''
>     date '+Time: %s.%N';
>     echo "---";
>     sleep $interval || exit 1;
> done
> EOF
> )
> ```

Right, makes sense. Feel free to open a PR with this, but please lose
the dependency on 'bc'. Either do the math in native shell, or just pass
the duration as a parameter from Flent.

Did you test whether this works on OpenWrt and on Dash?


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/issues/236#issuecomment-919035245
_______________________________________________
Flent-users mailing list -- flent-users@flent.org
To unsubscribe send an email to flent-users-le...@flent.org

Reply via email to