deb-sahara/sahara/plugins/spark/resources/topology.sh
Sergey Reshetnyak e5bf36f5ce Fix bashate errors
Change-Id: I0bc91817787a95a04eb3f951e4e2067192ccd67c
2014-10-08 18:21:49 +04:00

22 lines
394 B
Bash

#!/bin/bash
HADOOP_CONF=/etc/hadoop
while [ $# -gt 0 ] ; do
nodeArg=$1
exec< ${HADOOP_CONF}/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