# This is the initial script that will check the OS version and launch the corrcet script for OS configuration for rConfig # Setup logging LOGFILE=install.log ## Set some Colors red=`tput setaf 1` green=`tput setaf 2` blue=`tput setaf 4` magenta=`tput setaf 5` cyan=`tput setaf 6` reset=`tput sgr0` OSMSG="Checking CentOS version..." sleep 1 echo $OSMSG; echo -ne '##### (33%)\r' sleep 1 echo -ne '############# (66%)\r' sleep 1 echo -ne '##########################(100%)\n' # Get major CentOS version 6 or 7 OSVERSION=$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos" | cut -d"-" -f3) echo "<<<< Start - $OSMSG >>>>" >> $LOGFILE 2>&1 if [[ "$OSVERSION" == 7 ]]; then echo "Launching CentOS 7 installation script..." echo "Launching CentOS 7 installation script..." >> $LOGFILE 2>&1 echo -e "${green}Status: Launching CentOS 7 installation script...${reset}\n"; cd /home >> $LOGFILE 2>&1 curl -O https://www.rconfig.com/downloads/scripts/centos7_install.sh -A "Mozilla" >> $LOGFILE 2>&1 chmod +x centos7_install.sh >> $LOGFILE 2>&1 sh ./centos7_install.sh elif [[ "$OSVERSION" == 6 ]]; then echo "Launching CentOS 6 installation script..." echo "Launching CentOS 6 installation script..." >> $LOGFILE 2>&1 echo -e "${green}Status: Launching CentOS 6 installation script...${reset}\n"; cd /home >> $LOGFILE 2>&1 curl -O https://www.rconfig.com/downloads/scripts/centos6_install.sh -A "Mozilla" >> $LOGFILE 2>&1 chmod +x centos6_install.sh >> $LOGFILE 2>&1 sh ./centos6_install.sh else # fail echo -e "${red}Status: The script has failed. Check install.log for details...\n"; echo -e "${red}The script will now terminate!!!${reset}\n"; exit; fi echo "<<<< End - $OSMSG >>>>"; >> $LOGFILE 2>&1