|
- #!/bin/bash
-
- red=`tput setaf 1`
- green=`tput setaf 2`
- reset=`tput sgr0`
- # Colors for an interactive output.
-
- if [[ $EUID -ne 0 ]]; then
- echo -e "${red}"
- echo -e "This script must be run as root\n\n"
- echo -e "${reset}"
- exit 1
- fi
- # Confirming that the script is only run by root and not by any other user.
-
- curl -Is https://dms-git.ameyo.net:8265/
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\ndms.git.ameyo.net:8265 is not reachable. Exiting the script.\n"
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\ndms.git.ameyo.net:8265 is reachable. Proceeding further.\n"
- echo -e "${reset}"
- curl -Is https://vault.centos.org/
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nvault.centos.org is not reachable. Exiting the script.\n"
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\nvault.centos.org is reachable. Proceeding further.\n"
- echo -e "${reset}"
- curl -Is https://buildlogs.centos.org/
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nbuildlogs.centos.org is not reachable. Exiting the script.\n"
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\nbuildlogs.centos.org is reachable. Proceeding further.\n"
- echo -e "${reset}"
- curl -Is https://download.fedoraproject.org/
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\ndownload.fedoraproject.org is not reachable. Exiting the script.\n"
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\ndownload.fedoraproject.org is reachable. Proceeding further.\n"
- echo -e "${reset}"
- curl -Is https://raw.githubusercontent.com/
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nraw.githubusercontent.com is not reachable. Exiting the script.\n"
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\nraw.githubusercontent.com is reachable. Proceeding further.\n"
- echo -e "${reset}"
- curl -Is https://yum.oracle.com/
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nyum.oracle.com is not reachable. Exiting the script.\n"
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\nyum.oracle.com is reachable. Proceeding further.\n"
- echo -e "${reset}"
- curl -Is https://mirrors.ircam.fr/
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nmirrors.ircam.fr is not reachable. Exiting the script.\n"
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\nmirrors.ircam.fr is reachable. Proceeding further.\n"
- echo -e "${reset}"
- fi
- fi
- fi
- fi
- fi
- fi
- fi
-
- mkdir -p /osUpgrade/
-
- if [ -f "/osUpgrade/stateFile" ]; then
- STATE=`cat /osUpgrade/stateFile`
- echo -e "State file found\n\n"
- # In case the state file exists, read the state from the file.
- else
- echo "0" > /osUpgrade/stateFile
- echo "Creating state"
- # Create the state file if it doesn't exist.
- fi
-
- if [ -f "/etc/centos-release" ]; then
- # Checks if the current OS is CentOS or AmeyOS
- cat /etc/centos-release | grep " 6."
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "ERROR...! This version of CentOS / AmeyoOS is not supported.\n\n" 2>&1 | tee /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case the version of AmeyOS or CentOS is not 6, then exit the program.
- else
- echo -e "${green}"
- echo -e "Starting the upgrade process.\n\n" 2>&1 | tee /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- # Displaying the message for starting the upgrade process.
- fi
- elif [ -f "/etc/os-release" ]; then
- # Checks if the system is upgraded from CentOS to Oracle Linux 6.
- if [[ $STATE -ge 13 ]]; then
- cat /etc/os-release | grep "PRETTY_NAME=\"Oracle Linux Server 6.10\""
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "ERROR...! This version of CentOS / AmeyoOS is not supported.\n" 2>&1 | tee /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # If the OS is not upgraded, then then exit the program.
- else
- echo -e "${green}"
- echo -e "Starting the upgrade process.\n\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- # Start the stopped upgrade process, if script is restarted again.
- fi
- else
- echo -e "${red}"
- echo -e "Wrong parameter passsed\n\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit -1
- # In case some wrong state is passed, stop the program.
- fi
- else
- exit -1
- fi
- # Verifying if the Linux Distribution can be upgraded or not.
-
- if [[ $STATE -le 0 ]]
- then
- if [ -f "/etc/issue" ]; then
- # Checks if /etc/issue exists.
- cat /etc/issue | grep "AmeyOS"
- if [[ $? -ne 0 ]]; then
- echo -e "${green}"
- echo -e "System is running on CentOS\n\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo -e "No GRUB updation is required\n\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo "1" > /osUpgrade/stateFile
- # If the device is running on CentOS, then no update is required.
- else
- # Oracle Linux Server 7.6, with Unbreakable Enterprise Kernel
- echo "title Oracle Linux Server 7.6, with Unbreakable Enterprise Kernel 4.14.35-1818.3.3.el7uek.x86_64" >> /boot/grub/grub.conf
- echo " root (hd0,0)" >> /boot/grub/grub.conf
- grep "kernel" /boot/grub/grub.conf | grep -m1 "vmlinuz-[1-9]" > /osUpgrade/tempGrub
- kernel=`grep "kernel" /boot/grub/grub.conf | grep -m1 "vmlinuz-[1-9]" | awk '{print $2}'`
- echo "\\$kernel" > /osUpgrade/tempKernel
- sed -i "s/\./\\\./g" /osUpgrade/tempKernel
- kernel=`cat /osUpgrade/tempKernel`
- sed -i "s/$kernel/\/vmlinuz-4\.14\.35-1818\.3\.3\.el7uek\.x86_64/g" /osUpgrade/tempGrub
- line=`cat /osUpgrade/tempGrub`
- echo "$line" >> /boot/grub/grub.conf
- echo " initrd /initramfs-4.14.35-1818.3.3.el7uek.x86_64.img" >> /boot/grub/grub.conf
-
- # Oracle Linux Server 7.6, with Linux
- echo "title Oracle Linux Server 7.6, with Linux 3.10.0-957.el7.x86_64" >> /boot/grub/grub.conf
- echo " root (hd0,0)" >> /boot/grub/grub.conf
- grep "kernel" /boot/grub/grub.conf | grep -m1 "vmlinuz-[1-9]" > /osUpgrade/tempGrub
- kernel=`grep "kernel" /boot/grub/grub.conf | grep -m1 "vmlinuz-[1-9]" | awk '{print $2}'`
- echo "\\$kernel" > /osUpgrade/tempKernel
- sed -i "s/\./\\\./g" /osUpgrade/tempKernel
- kernel=`cat /osUpgrade/tempKernel`
- sed -i "s/$kernel/\/vmlinuz-3\.10\.0-957\.el7\.x86_64/g" /osUpgrade/tempGrub
- line=`cat /osUpgrade/tempGrub`
- echo "$line" >> /boot/grub/grub.conf
- echo " initrd /initramfs-3.10.0-957.el7.x86_64.img" >> /boot/grub/grub.conf
-
- # System Upgrade (redhat-upgrade-tool)
- echo "title System Upgrade (redhat-upgrade-tool)" >> /boot/grub/grub.conf
- echo " root (hd0,0)" >> /boot/grub/grub.conf
- line=" kernel /vmlinuz-redhat-upgrade-tool "
- echo "" > /osUpgrade/tempSysUpgrade
- for i in `grep "kernel" /boot/grub/grub.conf | grep -m1 "vmlinuz-[1-9]"`
- do
- echo $i | grep "root=" >> /osUpgrade/tempSysUpgrade
- done
- line="$line `cat /osUpgrade/tempSysUpgrade` ro"
- echo "" > /osUpgrade/tempSysUpgrade
- for i in `grep "kernel" /boot/grub/grub.conf | grep -m1 "vmlinuz-[1-9]"`
- do
- echo $i | grep "rd_LVM_LV=" >> /osUpgrade/tempSysUpgrade
- done
- grep "rd_LVM_LV" /osUpgrade/tempSysUpgrade
- if [[ $? -ne 0 ]]; then
- echo "rd_NO_LVM" > /osUpgrade/tempSysUpgrade
- line="$line rd_NO_LUKS rd.locale.LANG=en_US.UTF-8"
- else
- sed -i 's/rd_LVM_LV/rd.lvm.lv/g' /osUpgrade/tempSysUpgrade
- line="$line rd.luks=0 rd.locale.LANG=en_US.UTF-8"
- fi
- line="$line `cat /osUpgrade/tempSysUpgrade` rd.md=0 vconsole.font=latarcyrheb-sun16 crashkernel=auto `cat /osUpgrade/tempSysUpgrade` KEYBOARDTYPE=pc vconsole.keymap=us rd.dm=0 upgrade init=/usr/libexec/upgrade-init enforcing=0 rd.plymouth=0 plymouth.enable=0 net.ifnames=0 consoleblank=0"
- echo "$line" | tr "\n" " " >> /boot/grub/grub.conf
- echo -e "\n initrd /initramfs-redhat-upgrade-tool.img" >> /boot/grub/grub.conf
-
- # Oracle Linux Server Unbreakable Enterprise Kernel
- echo "title Oracle Linux Server Unbreakable Enterprise Kernel (4.1.12-124.48.6.el6uek.x86_64)" >> /boot/grub/grub.conf
- echo " root (hd0,0)" >> /boot/grub/grub.conf
- grep "kernel" /boot/grub/grub.conf | grep -m1 "vmlinuz-[1-9]" > /osUpgrade/tempGrub
- kernel=`grep "kernel" /boot/grub/grub.conf | grep -m1 "vmlinuz-[1-9]" | awk '{print $2}'`
- echo "\\$kernel" > /osUpgrade/tempKernel
- sed -i "s/\./\\\./g" /osUpgrade/tempKernel
- kernel=`cat /osUpgrade/tempKernel`
- sed -i "s/$kernel/\/vmlinuz-4\.1\.12-124\.48\.6\.el6uek\.x86_64/g" /osUpgrade/tempGrub
- line=`cat /osUpgrade/tempGrub`
- echo "$line" >> /boot/grub/grub.conf
- echo " initrd /initramfs-4.1.12-124.48.6.el6uek.x86_64.img" >> /boot/grub/grub.conf
-
- echo "1" > /osUpgrade/stateFile
- # Updating the grub.conf file in case of AmeyOS
- fi
- else
- echo -e "${red}"
- echo -e "The /etc/issue file is not found, can't proceed with the upgrade" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # Stops if no /etc/issue file is found
- fi
- fi
-
- if [[ $STATE -le 1 ]]
- then
- echo -e "${green}"
- echo -e "\nSaving the enabled services lest in a file\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- chkconfig --list | grep 3:on | awk '{print $1}' > /osUpgrade/serviceFile
- # Saving the enabled services in a file
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! Please visit /osUpgrade/upgradeLogFile for the complete report.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nService File successfully\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "2" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 2 ]]
- then
- echo -e "${green}"
- echo -e "\nStarting to remove old yum repository\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- rm -rvf /etc/yum.repos.d/* 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Removing the existing expired yum repository
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! yum repo deletion not possible, please check the /osUpgrade/upgradeLogFile for complete report.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nYum repositories deleted successfully\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "3" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 3 ]]
- then
- echo -e "${green}"
- echo -e "\nRestoring the yum repositories which has met EOL${reset}\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/CentOS6/raw/branch/master/CentOS/centos6-eol.repo --output /etc/yum.repos.d/CentOS-Base.repo 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Using the Vault repository, set up its repo configuration instead of the now default repositories configuration
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! Please restart the script as CentOS repo can't be downloaded.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nYum repositories successfully restored${reset}\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "4" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 4 ]]
- then
- echo -e "${green}"
- echo -e "\nRestoring the EPEL repositories\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/CentOS6/raw/branch/master/CentOS/centos6-epel-eol.repo --output /etc/yum.repos.d/epel.repo 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Installing the EPEL repository
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! Please restart the script as EPEL repo can't be downloaded.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nEPEL repository successfully restored\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "5" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 5 ]]
- then
- echo -e "${green}"
- echo -e "\nInstalling the CentOS Release SCL\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yum -y install centos-release-scl 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Installing the CentOS Release SCL packages
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! please check the /osUpgrade/upgradeLogFile file for the logs and restart the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nCentOS Release SCL installed successful\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "6" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 6 ]]
- then
- echo -e "${green}"
- echo -e "\nFixing the SCLO repositories\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/CentOS6/raw/branch/master/CentOS/centos6-scl-eol.repo --output /etc/yum.repos.d/CentOS-SCLo-scl.repo 2>&1 | tee -a /osUpgrade/upgradeLogFile
- curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/CentOS6/raw/branch/master/CentOS/centos6-scl-rh-eol.repo --output /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Fixing SCLO repositories
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! Please restart the script as SCL repos can't be downloaded.\nFor logs, refer to /osUpgrade/upgradeLogFile\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nCentOS Release SCL installed successful\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "7" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 7 ]]
- then
- echo -e "${green}"
- echo -e "\nUpdating the centos 6 packages\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yum update -y 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Updating the system repositories
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! please check the /osUpgrade/upgradeLogFile file for the logs and restart the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nCentOS packages successfuly updated\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "8" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 8 ]]
- then
- echo -e "${green}"
- echo -e "\nDownloading centos2ol script\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- curl https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh --output /usr/bin/centos2ol 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Downloads the centos2ol script
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! Upgrade Script from Oracle can't be downloaded, please restart the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\ncentos2ol script downloaded successfuly\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "9" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 9 ]]
- then
- echo -e "${green}"
- echo -e "\nAdding execute permissions to centos2ol\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- chmod +x /usr/bin/centos2ol 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Adds execution permission to centos2ol script
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! please check the /osUpgrade/upgradeLogFile file for the logs and restart the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nExecute permissions added successfuly\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "10" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 10 ]]
- then
- echo -e "${green}"
- echo -e "\nRemoving the conflicting php packages\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yum remove php* -y 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Removes the conflicting php packages as we have explicitly upgraded the packages
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! please check the /osUpgrade/upgradeLogFile file for the logs and restart the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nExecute permissions added successfuly\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "11" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 11 ]]
- then
- echo -e "${green}"
- echo -e "\nRemoving future conflicting packages\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yum remove -y AmeyOS6-patcher-5-5.x86_64 apr-util-ldap-1.3.9-3.el6_0.1.x86_64 avahi-compat-libdns_sd-0.6.25-17.el6.x86_64 cloog-ppl-0.15.7-1.2.el6.x86_64 cracklib-python-2.8.16-4.el6.x86_64 crmsh-1.2.6-5.1.x86_64 freetds-0.91-2.el6.x86_64 gamin-python-0.1.10-9.el6.x86_64 gd-devel-2.0.35-11.el6.x86_64 gnome-themes-2.28.1-7.el6.noarch hal-info-20090716-5.el6.noarch libXdmcp-devel-1.1.1-3.el6.x86_64 libproxy-bin-0.3.0-10.el6.x86_64 libproxy-python-0.3.0-10.el6.x86_64 newt-devel-0.52.11-4.el6.x86_64 pacemaker-libs-1.1.18-3.el6.x86_64 perl-Crypt-PasswdMD5-1.3-6.el6.noarch perl-Net-Telnet-3.03-11.el6.noarch perl-String-CRC32-1.4-9.el6.x86_64 perl-YAML-Syck-1.07-4.el6.x86_64 ppl-0.10.2-11.el6.x86_64 pssh-2.3.1-5.el6.noarch pulseaudio-esound-compat-0.9.21-26.el6.x86_64 python-argparse-1.2.1-2.1.el6.noarch python-iwlib-0.1-1.2.el6.x86_64 python-psutil-0.6.1-1.el6.x86_64 pyxf86config-0.3.37-7.1.el6.x86_64 readahead-1.5.6-2.el6.x86_64 setools-3.3.7-4.el6.x86_64 setools-gui-3.3.7-4.el6.x86_64 setools-libs-tcl-3.3.7-4.el6.x86_64 slang-devel-2.2.1-1.el6.x86_64 system-config-firewall-tui-1.2.27-7.2.el6_6.noarch system-gnome-theme-60.0.2-1.el6.noarch tigervnc-server-module-1.1.0-24.el6.x86_64 udisks-1.0.1-11.el6.x86_64 xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x86_64 esound-libs-0.2.41-3.1.el6.x86_64 esound-tools-0.2.41-3.1.el6.x86_64 xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch lldpad-libs-0.9.46-10.el6_8.x86_64 java_cup-0.10k-5.el6.x86_64 libart_lgpl-devel-2.3.20-5.1.el6.x86_64 libidn-devel-1.18-2.el6.x86_64 libsrtp-devel-1.5.4-3.el6.x86_64 libusb-devel-0.1.12-23.el6.x86_64 perl* jansson-devel libxml2-devel opus-devel libvorbis-devel gsm-devel hiredis acp libsrtp jansson hiredis-devel pjproject libuuid-devel speex-devel libogg-devel sqlite2 opus libresample-devel libxslt-devel corosynclib-devel libtool-ltdl-devel libresample sqlite2-devel xmlstarlet epel-release asterisk13-dependencies-centos-6.5 sqlite-devel libsrtp-devel libedit-devel openldap-devel libical-devel subversion lua-devel rpm-build byacc portaudio-devel jack-audio-connection-kit-devel speex-devel mysql-devel gettext-libs systemtap-client rcs libsrtp portaudio libresample lm_sensors-devel opus-devel mysql hiredis neon-devel sqlite2-devel corosynclib-devel spandsp-devel libsrtp-devel unixODBC-devel gsm-devel gettext-devel git libgfortran systemtap-devel patchutils swig diffstat libtiff-devel elfutils-devel libical sqlite2 expat-devel asterisk13-dependencies-centos-6.7 cyrus-sasl-devel radiusclient-ng-devel libvorbis-devel libresample-devel libxslt-devel sqlite-devel bluez-libs-devel libedit-devel opus libgcj gcc-gfortran rpm-devel indent cscope elfutils-libelf-devel libxml2-devel popt-devel libogg-devel radiusclient-ng iksemel-devel pjproject-devel libuuid-devel systemtap ctags acp jack-audio-connection-kit pjproject file-devel iksemel hiredis-devel jansson-devel libtool-ltdl-devel xmlstarlet net-snmp-devel intltool doxygen spandsp tcp_wrappers-devel jansson mx openoffice.org-opensymbol-fonts xinetd sun-javadb* ipa-client tzdata-java eog latencytop perf libopenraw-gnome jline libldb sinjdoc axis crash-trace-command gnome-keyring-pam gdm-libs theora-tools gnome-media-libs festival libavc1394 python-matplotlib libgdata gstreamer-plugins-good sssd-ldap gnome-panel-libs nautilus oddjob-mkhomedir plymouth-gdm-hooks gdm-user-switch-applet alsa-plugins-pulseaudio gok sssd-client hwloc iotop xml-commons-resolver mx4j-javadoc crash-gcore-command ltrace python-crypto polkit-gnome ConsoleKit-x11 gnome-python2-gnomevfs giflib pgdg-centos93 pulseaudio-utils PackageKit postgresql93-tcl-debuginfo atlas sssd-common-pac gnome-python2-applet gnome-settings-daemon seekwatcher oprofile cas libopenraw libhugetlbfs-utils jakarta-commons-logging java-1.5.0-gcj classpathx-jaf libcollection jakarta-commons-httpclient bcel mcelog python-paramiko samba4-libs libgnomekbd python-sssdconfig latrace python-netaddr libini_config postgresql93-odbc postgresql93-docs PyGreSQL-debuginfo sssd-krb5-common sssd-ipa sssd certmonger gdm-plugin-fingerprint pulseaudio-module-x11 gvfs-archive vino samba-client at-spi festival-speechtools-libs exempi xorg-x11-drv-wacom libexif festival-lib gnome-python2-gconf GConf2-gtk PackageKit-yum PackageKit-yum-plugin xorg-x11-xinit plymouth-utils libgtop2 gnome-desktop at-spi-python control-center pulseaudio-gdm-hooks jpackage-utils libopenraw-devel jakarta-commons-discovery classpathx-mail libref_array wsdl4j mx4j valgrind libsss_idmap libxklavier pytz libtopology python-nose SDL libipa_hbac cyrus-sasl-gssapi java-1.7.0-openjdk postgresql93-pltcl sssd-common sssd-ad sssd-proxy ipa-python vte gnome-applets orca gnome-power-manager gvfs-fuse gnome-packagekit gnome-vfs2-smb DeviceKit-power pulseaudio-libs-glib2 libXScrnSaver pyorbit festvox-slt-arctic-hts gnome-python2-desktop libiec61883 gnome-mag libgsf PackageKit-gtk-module PackageKit-device-rebind xdg-user-dirs libgweather taglib gnome-python2-libwnck fuse-libs libv4l gnome-python2-bonobo nautilus-extensions libwacom-data gnome-session gnome-session-xsession control-center-extra pulseaudio-module-gconf xdg-user-dirs-gtk tigervnc-server-applet dstat libdhash log4j powertop mx4j-manual latencytop-tui python-ldap libipa_hbac-python python-krbV dbus-x11 numpy gucharmap gnome-python2-extras libshout postgresql93-tcl PackageKit-glib postgresql93-odbc-debuginfo libdv polkit-desktop-policy fuse gnome-python2-libegg libwacom gnome-panel NetworkManager-gnome latencytop-common gnome-screensaver numad gvfs-smb java-1.6.0-openjdk libopenraw-gnome-devel rhino xml-commons-apis libbasicobjects regexp python-kerberos nfs4-acl-tools pytalloc gnome-menus trace-cmd libraw1394 libpath_utils gnome-media gnome-speech postgresql93-test librsvg2 evolution-data-server sssd-krb5 gnome-python2-gnome libgail-gnome gdm 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Removing conflicting packages
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo "ERROR...! Please restart the script as packages can't be removed." 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo "Packages removed successfully." 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo -e "\n\n\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo "12" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 12 ]]
- then
- echo -e "${green}"
- echo -e "\nRuning centos2ol script from oracle\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- centos2ol 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Runs the centos2ol script
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! please check the /osUpgrade/upgradeLogFile file for the logs and restart the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\ncentos2ol script ran successfuly\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "13" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 13 ]]
- then
- echo -e "${green}"
- echo -e "\nUpdating the Oracle 6 packages\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yum -y update 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Updating the Oracle 6 packages
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! please check the /osUpgrade/upgradeLogFile file for the logs and re-run the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nCentOS packages successfuly updated\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "14" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 14 ]]
- then
- echo -e "${green}"
- echo -e "\nEnabling the OL6 Addons\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yum-config-manager --enable ol6_addons 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Enabling the ol6_addons repo
- if [[ $? -ne 0 ]]; then
- echo -e "${red}"
- echo -e "\nERROR...! please check the /osUpgrade/upgradeLogFile file for the logs and run the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- # In case any error is generated, exit the process.
- else
- echo -e "${green}"
- echo -e "\nOL6 addons successfuly enabled\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "15" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 15 ]]
- then
- echo -e "${green}"
- echo -e "\nInstalling the tools required\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yum install -y openscap redhat-upgrade-tool preupgrade-assistant preupgrade-assistant-el6toel7 preupgrade-assistant-el6toel7-data-0 preupgrade-assistant-tools preupgrade-assistant-ui 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Installing the required update tools
- if [[ $? -ne 0 ]]; then
- echo -e "\nERROR...! please check the /osUpgrade/upgradeLogFile file for the logs and run the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\nRequired tools installed successfully\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "16" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 16 ]]
- then
- echo -e "${green}"
- echo -e "\nRemoving pre-defined packages (if-present)\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yum remove -y modcluster corosync pacemaker pcs ricci ccs 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Installing the required update tools
- if [[ $? -ne 0 ]]; then
- echo -e "\nERROR...! re-run the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\nPackages removed successfully\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "17" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 17 ]]
- then
- echo -e "${green}"
- echo -e "\nDownloading the OracleLinux7.6.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- curl http://mirrors.ircam.fr/pub/oraclelinux/OL7/u6/x86_64/OracleLinux-R7-U6-Server-x86_64-dvd.iso --output ./OracleLinux-R7-U6-Server-x86_64-dvd.iso 2>&1 | tee -a /osUpgrade/upgradeLogFile
- if [[ $? -ne 0 ]]; then
- echo -e "\nERROR...! Download Unsuccessful, please re-run the script.\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "\nOracle Linux 7.6 downloaded successfully\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "18" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 18 ]]
- then
- echo -e "${green}"
- echo -e "\nStarting the Pre-Upgrade Tool\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yes | preupg
- # Start the pre-upgrade tool
- echo -e "${green}"
- echo -e "\nPreUpgrade Tool ran successfully, please check and resolve the errors present in ./preupgrade/result.html (if any)\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "19" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
-
- if [[ $STATE -le 19 ]]
- then
- echo -e "${green}"
- echo -e "\nRunning the redhat upgrade tool\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- yes | redhat-upgrade-tool-cli --iso OracleLinux-R7-U6-Server-x86_64-dvd.iso --debuglog=/osUpgrade/upgrade.log --cleanup-post
- # Upgrading the OS by running redhat-upgrade-tool
- echo -e "${green}"
- echo -e "\nRedHat Upgrade Tool ran successfully\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "20" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
-
- if [[ $STATE -le 20 ]]
- then
- echo -e "${green}"
- echo "Restoring Oracle7 repositories" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- mkdir -p /osUpgrade/yum-ol7
- curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/UpgradeOS-EL6/raw/branch/master/yum-ol7/oracle-linux-ol7.repo --output /osUpgrade/yum-ol7/oracle-linux-ol7.repo 2>&1 | tee -a /osUpgrade/upgradeLogFile
- curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/UpgradeOS-EL6/raw/branch/master/yum-ol7/uek-ol7.repo --output /osUpgrade/yum-ol7/uek-ol7.repo 2>&1 | tee -a /osUpgrade/upgradeLogFile
- curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/UpgradeOS-EL6/raw/branch/master/yum-ol7/virt-ol7.repo --output /osUpgrade/yum-ol7/virt-ol7.repo 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Fixing Oracle 7 repository
- if [[ $? -ne 0 ]]; then
- echo -e "ERROR...! Please restart the script Oracle7 repo can't be downloaded." 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "Oracle7 repository successfully restored" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo -e "\n\n\n" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo "21" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 21 ]]
- then
- echo -e "${green}"
- echo -e "Adding reboot configurations" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/UpgradeOS-EL6/raw/branch/master/fix-ol7.sh --output /osUpgrade/fix-ol7.sh 2>&1 | tee -a /osUpgrade/upgradeLogFile
- # Fixing Oracle 7 scripts
- if [[ $? -ne 0 ]]; then
- echo "ERROR...! Please restart the script as fix-ol7 script can't be downloaded." 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "fix-ol7 script successfully downloaded." 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo -e "\n\n\n"
- echo "22" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- if [[ $STATE -le 22 ]]
- then
- echo -e "${green}"
- echo "Adding services to run on reboot" 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo "bash /osUpgrade/fix-ol7.sh" >> /etc/rc.d/rc.local
- # Running reboot tasks
- if [[ $? -ne 0 ]]; then
- echo "ERROR...! Please restart the script." 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- exit 1
- else
- echo -e "${green}"
- echo -e "Reboot services added successfully." 2>&1 | tee -a /osUpgrade/upgradeLogFile
- echo -e "${reset}"
- echo -e "\n\n\n"
- echo "23" > /osUpgrade/stateFile
- # Proceeding further with the upgrade in case everything is successful.
- fi
- fi
-
- reboot
|