Skip to content

Instantly share code, notes, and snippets.

@lukebakken
Created April 29, 2014 21:38
Show Gist options
  • Save lukebakken/048b34a97151a2f70706 to your computer and use it in GitHub Desktop.
Save lukebakken/048b34a97151a2f70706 to your computer and use it in GitHub Desktop.
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