#!/bin/sh

# Pull environment for this install
. "/usr/local/lib/riak-cs/lib/env.sh"

# Make sure the user running this script is the owner and/or su to that user
check_user $@

# Make sure CWD is set to runner run dir
cd $RUNNER_BASE_DIR

# Identify the script name
SCRIPT=`basename $0`

# Check the first argument for instructions
case "$1" in
    list-members|weight|weight-manifest|weight-block|refresh)
        # Make sure the local node IS running
        node_up_check

        $NODETOOL rpc riak_cs_multibag_console "$@"
        ;;
    *)
        echo "Usage: $SCRIPT { list-members |  weight | weight-manifest | weight-block | refresh }"
        exit 1
        ;;
esac
