#!/bin/bash START=$(date +%s) bold=$(tput bold) normal=$(tput sgr0) clear cd read -p "Hello, who am I talking to? " userName clear echo It\'s nice to meet you $userName. I am ${bold}Sahar${normal}, the author of this script. This script will install the following few softwares so that your cayenne installation go smooth: echo echo "1. Python 3" echo "2. pip3" echo "3. psutil" echo "4. paho.mqtt.python" echo "5. netifaces" echo "6. jsonpickle" echo "7. enum34" echo read -p "Do you want to continue (y/n)?" CONT if [ "$CONT" = "n" ]; then clear exit 1 || return 1 else sudo apt-get install git -y sudo apt-get install unzip -y sudo apt-get install wget -y sudo apt-get update -y clear fi echo -ne '\007' now=$(date) echo -e "\e[31;43m***** Welcome. Automatic Installation Begins *****\e[0m" echo -e "\e[31;43m*** Current Date and Time : $now ***\e[0m" echo -e "\e[31;43m***** Installing Python3 *****\e[0m" sudo apt-get install python3 -y sudo apt-get install python3-pip -y echo -e "\e[31;43m***** Setting Python3 As default *****\e[0m" cd echo "alias python='/usr/bin/python3.5'" >> ~/.bashrc echo -e "\e[31;43m***** Installing psutil *****\e[0m" git clone https://github.com/giampaolo/psutil.git cd psutil python setup.py install echo -e "\e[31;43m***** Installing paho.mqtt.python *****\e[0m" cd git clone https://github.com/eclipse/paho.mqtt.python cd paho.mqtt.python python setup.py install echo -e "\e[31;43m***** Installing Netifaces *****\e[0m" cd wget "https://www.dropbox.com/s/c965syanfe3otsq/netifaces-0.10.7.zip?dl=0" mv netifaces-0.10.7.zip?dl=0 netifaces-0.10.7.zip unzip netifaces-0.10.7.zip rm -rf *zip cd netifaces-0.10.7 python setup.py install echo -e "\e[31;43m***** Installing jsonpickle *****\e[0m" cd git clone git://github.com/jsonpickle/jsonpickle.git cd jsonpickle python setup.py install echo -e "\e[31;43m***** Installing enum34 *****\e[0m" cd wget "https://www.dropbox.com/s/o5hk2ppfyucdo23/enum34-1.1.6.zip?dl=0" mv enum34-1.1.6.zip?dl=0 enum34-1.1.6.zip unzip enum34-1.1.6.zip rm -rf enum34-1.1.6.zip cd enum34-1.1.6 python setup.py install cd echo -e "\e[31;43m***** Updating System *****\e[0m" sudo apt-get update -y echo -e "\e[31;43m***** All Done! *****\e[0m" END=$(date +%s) DIFF=$(( $END - $START )) echo "It took $DIFF seconds to complete this installation process." read -p "Do you want to reboot now (y/n)?" CONT if [ "$CONT" = "y" ]; then echo "Rebooting ..."; sudo reboot now else echo "Please reboot manually."; fi