deb-sahara/sahara/plugins/mapr/resources/topology.sh
artemosadchiy a6df0c1dfc Refactor MapR plugin for Sahara
Implements: blueprint mapr-refactor
Change-Id: Ib4385845a00aab2506dddccb9e6a6f3297a5622d
2015-02-17 18:41:26 +02:00

21 lines
385 B
Bash

#!/bin/bash
MAPR_HOME=/opt/mapr
while [ $# -gt 0 ] ; do
nodeArg=$1
exec< ${MAPR_HOME}/topology.data
result=""
while read line ; do
ar=( $line )
if [ "${ar[0]}" = "$nodeArg" ]; then
result="${ar[1]}"
fi
done
shift
if [ -z "$result" ]; then
echo -n "/default/rack "
else
echo -n "$result "
fi
done