aboutsummaryrefslogtreecommitdiff
path: root/sbin/slaves.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/slaves.sh')
-rwxr-xr-xsbin/slaves.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/slaves.sh b/sbin/slaves.sh
index cdad47ee2e..c971aa3296 100755
--- a/sbin/slaves.sh
+++ b/sbin/slaves.sh
@@ -36,10 +36,11 @@ if [ $# -le 0 ]; then
exit 1
fi
-sbin="`dirname "$0"`"
-sbin="`cd "$sbin"; pwd`"
+if [ -z "${SPARK_HOME}" ]; then
+ export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
+fi
-. "$sbin/spark-config.sh"
+. "${SPARK_HOME}/sbin/spark-config.sh"
# If the slaves file is specified in the command line,
# then it takes precedence over the definition in
@@ -65,7 +66,7 @@ then
shift
fi
-. "$SPARK_PREFIX/bin/load-spark-env.sh"
+. "${SPARK_HOME}/bin/load-spark-env.sh"
if [ "$HOSTLIST" = "" ]; then
if [ "$SPARK_SLAVES" = "" ]; then