#!/bin/sh
# -*- tab-width:4;indent-tabs-mode:nil -*-
# ex: ts=4 sw=4 et

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

# Make sure the user running this script is the owner and/or su to that user
check_user $@
ES=$?
if [ "$ES" -ne 0 ]; then
    exit $ES
fi

# Keep track of where script was invoked
ORIGINAL_DIR=$(pwd)

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

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

# Make sure the local node IS running
echoerr "** The search-cmd tool is for a deprecated version of Riak Search."
echoerr "** Please upgrade to the new version of Riak Search."
echoerr ""
node_up_check
$NODETOOL rpc_infinity riak_search_cmd command $ORIGINAL_DIR "$@"
