diff options
Diffstat (limited to 'custom/uucp-mediaserver/scripts/queuesize')
-rwxr-xr-x | custom/uucp-mediaserver/scripts/queuesize | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/custom/uucp-mediaserver/scripts/queuesize b/custom/uucp-mediaserver/scripts/queuesize new file mode 100755 index 00000000..3b98ccdb --- /dev/null +++ b/custom/uucp-mediaserver/scripts/queuesize | |||
@@ -0,0 +1,24 @@ | |||
1 | #!@zsh@/bin/zsh | ||
2 | |||
3 | base=$(basename $0) | ||
4 | suffix=${base##*.} | ||
5 | |||
6 | #sent=$(cat /var/queuesize.$suffix) | ||
7 | #uustat -s $suffix | grep 'Executing recv-media' | sed -r 's/^.*\(sending ([0-9]+) bytes\)/\1/' | awk "BEGIN{s=${sent}}{s+=\$1}END{print s}" | ||
8 | |||
9 | awk 'BEGIN{s=0}{s+=$1}END{print s;}' @queueDir@/${suffix}.queuesize | ||
10 | |||
11 | # typeset -a queued | ||
12 | # queued=() | ||
13 | |||
14 | # ids=$({ uustat -s $suffix | cut -d ' ' -f 1; cut -d ' ' -f 2 /var/queuesize.$suffix } | sort | uniq -d ) | ||
15 | # queued=(${(f)ids}) | ||
16 | |||
17 | # sum=0 | ||
18 | |||
19 | # while read size id; do | ||
20 | # [[ ${queued[(r)$id]} == ${(q)id} ]] || continue | ||
21 | # sum=$((sum + size)) | ||
22 | # done < /var/queuesize.$suffix | ||
23 | |||
24 | # print $sum | ||