Skip to content

Commit

Permalink
Use -d directory test in launch.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tmckayus committed Jan 24, 2017
1 parent 6020603 commit ccb72d2
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions scripts/spark/added/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ export LD_PRELOAD=libnss_wrapper.so

# If the UPDATE_SPARK_CONF_DIR dir is non-empty,
# copy the contents to $SPARK_HOME/conf
if [ -n "$UPDATE_SPARK_CONF_DIR" ]; then
ls -1 $UPDATE_SPARK_CONF_DIR &> /dev/null
if [ $? -eq 0 ]; then
sparkconfs=$(ls -1 $UPDATE_SPARK_CONF_DIR | wc -l)
if [ "$sparkconfs" -ne "0" ]; then
echo "Copying from $UPDATE_SPARK_CONF_DIR to $SPARK_HOME/conf"
ls -1 $UPDATE_SPARK_CONF_DIR
cp $UPDATE_SPARK_CONF_DIR/* $SPARK_HOME/conf
fi
else
echo "$UPDATE_SPARK_CONF_DIR does not exist, using default spark config"
if [ -d "$UPDATE_SPARK_CONF_DIR" ]; then
sparkconfs=$(ls -1 $UPDATE_SPARK_CONF_DIR | wc -l)
if [ "$sparkconfs" -ne "0" ]; then
echo "Copying from $UPDATE_SPARK_CONF_DIR to $SPARK_HOME/conf"
ls -1 $UPDATE_SPARK_CONF_DIR
cp $UPDATE_SPARK_CONF_DIR/* $SPARK_HOME/conf
fi
elif [ -n "$UPDATE_SPARK_CONF_DIR" ]; then
echo "Directory $UPDATE_SPARK_CONF_DIR does not exist, using default spark config"
fi


# If SPARK_MASTER_ADDRESS env varaible is not provided, start master,
# otherwise start worker and connect to SPARK_MASTER_ADDRESS
if [ -z ${SPARK_MASTER_ADDRESS+_} ]; then
Expand Down

0 comments on commit ccb72d2

Please sign in to comment.