Skip to content

Instantly share code, notes, and snippets.

@muhqu
Created February 3, 2011 12:52
Show Gist options
  • Save muhqu/809438 to your computer and use it in GitHub Desktop.
Save muhqu/809438 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ -z $1 ]; then
echo "usage: $0 NAME URL [ NAME URL ... ]"
echo " e.g.: $0 LOCAL http://127.0.0.1:5984"
echo " or: $0 DB01 http://user:pass@db01 DB02 http://user:pass@db01"
exit 1
fi
(
while [ ! -z $1 ]; do
NAME=$1; shift
URL=$1; shift
curl -qs "$URL/_active_tasks" | python -mjson.tool | awk "{print \"$NAME: \"\$0}"
done
) | sed -e 's/ */ /g' -e 's/[",]//g' | grep -E 'status|task'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment