Skip to content

Instantly share code, notes, and snippets.

@lukebakken
Created April 29, 2014 21:38
Embed
What would you like to do?
Watch Riak Transfers
#!/usr/bin/env bash
function xfers_in_progress
{
local tmp="$(mktemp)"
riak-admin transfers > "$tmp" 2>&1
fgrep -qi 'No transfers active' "$tmp"
declare -i rv=$?
rm -f "$tmp"
if (( rv == 1 ))
then
return 0
else
return 1
fi
}
while xfers_in_progress
do
echo 'Transfers in progress...'
sleep 5
done
echo 'Transfers done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment