shell script to install spark 2.1.1

#! /bin/bash
echo download scala
wget http://downloads.typesafe.com/scala/2.12.2/scala-2.12.2.tgz
tar xvf scala-2.12.2.tgz
mv scala-2.12.2 /usr/lib
ln -s /usr/lib/scala-2.12.2 /usr/lib/scala
export PATH=$PATH:/usr/lib/scala/bin
scala -version

echo download spark
wget http://d3kbcqa49mib13.cloudfront.net/spark-2.1.1-bin-hadoop2.7.tgz
tar xvf spark-2.1.1-bin-hadoop2.7.tgz

export SPARK_HOME=$HOME/spark-2.1.1-bin-hadoop2.7
export PATH=$PATH:$SPARK_HOME/bin

firewall-cmd –permanent –zone=public –add-port=6066/tcp
firewall-cmd –permanent –zone=public –add-port=7077/tcp
firewall-cmd –permanent –zone=public –add-port=8080-8081/tcp
firewall-cmd –reload

echo ‘export PATH=$PATH:/usr/lib/scala/bin’ >> .bash_profile
echo ‘export SPARK_HOME=$HOME/spark-2.12.2-bin-hadoop2.7’ >> .bash_profile
echo ‘export PATH=$PATH:$SPARK_HOME/bin’ >> .bash_profile