#!/bin/bash
#
# We use the jobtracker as provisioning server
#
HOSTNAME=$( hostname -f )

ARG=$1
SERVICE_CMD=/usr/sbin/service
STARTUP_SCRIPT=hbase-master
REMOTE_CMD=dsh
DSH_GROUPNAME=hbase-master

function action_loop(){
    ACTION=$ARG
    dsh -g ${DSH_GROUPNAME} -cM -- ${SERVICE_CMD} ${STARTUP_SCRIPT} ${ACTION}
}

case "$ARG" in
  start|restart|reload|force-reload)
        action_loop
        ;;
  status|stop)
        action_loop
        ;;
  *)
        echo "Usage: $0 start|stop|restart|status" >&2
        exit 3
        ;;
esac

exit 0

