You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/bin/bash
- MY_PARAM=${1:-0}
-
- ####################################################################
-
- red=`tput setaf 1`
- green=`tput setaf 2`
- reset=`tput sgr0`
-
- ####################################################################
-
- if [[ $EUID -ne 0 ]]; then
- echo "${red}This script must be run as root${reset}"
- exit 1
- fi
-
- mkdir -p /tmp/oracle6-7/
-
- ####################################################################
-
- echo "${green}Upgrade Oracle 7 script started.${reset}"
- echo -e "\n\n\n"
- echo "${green}Performing Upgrade tasks.${reset}"
- sleep 2
- echo -e "\n\n\n"
-
- ####################################################################
-
- if [[ $MY_PARAM -le 0 ]]
- then
- echo "${green}Running the redhat upgrade tool${reset}"
-
- redhat-upgrade-tool-cli --iso OracleLinux-R7-U6-Server-x86_64-dvd.iso --debuglog=/tmp/oracle6-7/upgrade.log --cleanup-post
- # Updating the Oracle 6 packages
-
- if [[ $? -ne 0 ]]; then
- echo "${red}ERROR...! please check the /tmp/oracle6-7/upgrade.log file for the logs and re-run the script.${reset}"
- exit 1
- else
- echo "${green}RedHat Upgrade Tool ran successfully${reset}"
- echo -e "\n\n\n"
- fi
- fi
-
- ####################################################################
-
- echo "${green}Upgrade tasks completed successfully.${reset}"
- echo -e "\n\n\n"
- sleep 1
- echo "${green}Performing Post-Upgradation tasks.${reset}"
- echo -e "\n\n\n"
- sleep 2
-
- ####################################################################
-
- if [[ $MY_PARAM -le 1 ]]
- then
- echo "${green}Downloading the future required scripts${reset}"
-
- curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/fix-oracle7 --output /usr/bin/fix-oracle7
-
- if [[ $? -ne 0 ]]; then
- echo "${red}ERROR...! Download failed, please re-run the script with argument '1'.${reset}"
- exit 1
- else
- echo "${green}Scripts downloaded successfuly${reset}"
- echo -e "\n\n\n"
- fi
- fi
-
- ####################################################################
-
- if [[ $MY_PARAM -le 2 ]]
- then
- echo "${green}Adding execute permissions to future scripts${reset}"
-
- chmod +x /usr/bin/fix-oracle7
- # Runs the centos2ol script
-
- if [[ $? -ne 0 ]]; then
- echo "${red}ERROR...! Execution permission error re-run the script with argument '2'.${reset}"
- exit 1
- else
- echo "${green}Execute permissions added successfuly${reset}"
- echo -e "\n\n\n"
- fi
- fi
-
- ####################################################################
-
- echo "${green}Post-Upgradation tasks completed successfully.${reset}"
- echo -e "\n\n\n"
- sleep 1
- echo "${green}Please reboot your machine for a complete upgrade.${reset}"
- echo -e "\n\n\n"
- sleep 2
-
- ####################################################################
|