summaryrefslogtreecommitdiff
path: root/custom/uucp-mediaserver/scripts/update-queuesize
diff options
context:
space:
mode:
Diffstat (limited to 'custom/uucp-mediaserver/scripts/update-queuesize')
-rwxr-xr-xcustom/uucp-mediaserver/scripts/update-queuesize10
1 files changed, 10 insertions, 0 deletions
diff --git a/custom/uucp-mediaserver/scripts/update-queuesize b/custom/uucp-mediaserver/scripts/update-queuesize
new file mode 100755
index 00000000..db1b3e2a
--- /dev/null
+++ b/custom/uucp-mediaserver/scripts/update-queuesize
@@ -0,0 +1,10 @@
1#!@zsh@/bin/zsh
2
3base=$(basename $0)
4suffix=${base##*.}
5
6uustat -s $suffix | grep 'Executing recv-media' | sed -r 's/^([^ ]+) .*\(sending ([0-9]+) bytes\)/\2 \1/' >> @queueDir@/${suffix}.queuesize
7tmpFile=$(mktemp --tmpdir=$HOME)
8sort -k 2 @queueDir@/${suffix}.queuesize | uniq -f 1 > "${tmpFile}"
9cat "${tmpFile}" >! @queueDir@/${suffix}.queuesize
10rm "${tmpFile}"