From a32aa6b351064f17779adcd8e89ebc0e98fc3096 Mon Sep 17 00:00:00 2001 From: KarthikTunga Date: Wed, 16 Oct 2013 22:51:09 -0700 Subject: Implementing --config argument in the scripts --- bin/spark-daemon.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bin/spark-daemon.sh') diff --git a/bin/spark-daemon.sh b/bin/spark-daemon.sh index 48d552f3db..262ef173be 100755 --- a/bin/spark-daemon.sh +++ b/bin/spark-daemon.sh @@ -29,7 +29,7 @@ # SPARK_NICENESS The scheduling priority for daemons. Defaults to 0. ## -usage="Usage: spark-daemon.sh [--config ] [--hosts hostlistfile] (start|stop) " +usage="Usage: spark-daemon.sh [--config ] (start|stop) " # if no args specified, show usage if [ $# -le 1 ]; then @@ -44,15 +44,17 @@ bin=`cd "$bin"; pwd` # get arguments -# check if conf dir passed as an argument +# Check if --config is passed as an argument. It is an optional parameter. +# Exit if the argument is a directory. + if [ "$1" == "--config" ] then shift conf_dir=$1 if [ ! -d "$conf_dir" ] then - echo "$conf_dir is not a valid directory" - echo "FOUL :"$usage + echo "ERROR : $conf_dir is not a directory" + echo $usage exit 1 else export SPARK_CONF_DIR=$conf_dir -- cgit v1.2.3