Created
April 29, 2014 21:38
-
-
Save lukebakken/048b34a97151a2f70706 to your computer and use it in GitHub Desktop.
Watch Riak Transfers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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