diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-05 22:05:05 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-05 22:05:05 +0200 |
commit | af359b71b000651812e1ee70638b480502eba0ec (patch) | |
tree | 8f246fa120b54c29f3bdf64e8e3b389ec5311851 /custom/uucp-mediaserver/scripts/update-queuesize | |
parent | fbc53fdb0e012524b1a22083d19a6928cc87870e (diff) | |
download | nixos-af359b71b000651812e1ee70638b480502eba0ec.tar nixos-af359b71b000651812e1ee70638b480502eba0ec.tar.gz nixos-af359b71b000651812e1ee70638b480502eba0ec.tar.bz2 nixos-af359b71b000651812e1ee70638b480502eba0ec.tar.xz nixos-af359b71b000651812e1ee70638b480502eba0ec.zip |
media-server on odin
Diffstat (limited to 'custom/uucp-mediaserver/scripts/update-queuesize')
-rwxr-xr-x | custom/uucp-mediaserver/scripts/update-queuesize | 10 |
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 | |||
3 | base=$(basename $0) | ||
4 | suffix=${base##*.} | ||
5 | |||
6 | uustat -s $suffix | grep 'Executing recv-media' | sed -r 's/^([^ ]+) .*\(sending ([0-9]+) bytes\)/\2 \1/' >> @queueDir@/${suffix}.queuesize | ||
7 | tmpFile=$(mktemp --tmpdir=$HOME) | ||
8 | sort -k 2 @queueDir@/${suffix}.queuesize | uniq -f 1 > "${tmpFile}" | ||
9 | cat "${tmpFile}" >! @queueDir@/${suffix}.queuesize | ||
10 | rm "${tmpFile}" | ||