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.

100 lines
5.6KB

  1. #!/bin/bash
  2. MY_PARAM=${1:-0}
  3. ####################################################################
  4. red=`tput setaf 1`
  5. green=`tput setaf 2`
  6. reset=`tput sgr0`
  7. ####################################################################
  8. if [[ $EUID -ne 0 ]]; then
  9. echo "${red}This script must be run as root${reset}"
  10. exit 1
  11. fi
  12. mkdir /tmp/fix-oracle7/
  13. ####################################################################
  14. echo "${green}Fix-Oracle7 script started.${reset}"
  15. echo -e "\n\n\n"
  16. echo "${green}Performing fixation tasks.${reset}"
  17. sleep 2
  18. echo -e "\n\n\n"
  19. ####################################################################
  20. if [[ $MY_PARAM -le 0 ]]
  21. then
  22. echo "${green}Starting to remove old yum repository${reset}"
  23. rm -rvf /etc/yum.repos.d/* 2> /tmp/fix-oracle7/oldRepo.log
  24. # Removing the existin yum repository
  25. if [[ $? -ne 0 ]]; then
  26. echo "${red}ERROR...! yum repo deletion not possible, please check the /tmp/fix-oracle7/oldRepo.log file for the logs and run the command again after correction.${reset}"
  27. exit 1
  28. else
  29. echo "${green}Yum repositories deleted successfully${reset}"
  30. echo -e "\n\n\n"
  31. fi
  32. fi
  33. ####################################################################
  34. if [[ $MY_PARAM -le 2 ]]
  35. then
  36. echo "${green}Restoring Oracle7 repositories${reset}"
  37. curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/public-yum-ol7.repo --output /etc/yum.repos.d/public-yum-ol7.repo
  38. # Fixing Oracle 7 repository
  39. if [[ $? -ne 0 ]]; then
  40. echo "${red}ERROR...! Please restart the script with argument '2' as Oracle7 repo can't be downloaded..${reset}"
  41. exit 1
  42. else
  43. echo "${green}Oracle7 repository successfully restored${reset}"
  44. echo -e "\n\n\n"
  45. fi
  46. fi
  47. ####################################################################
  48. 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
  49. ####################################################################
  50. yum install -y openssh*
  51. yum install -y php
  52. yum update -y
  53. ####################################################################
  54. systemctl enable --now sshd
  55. ####################################################################
  56. mkdir /tmp/postgres
  57. curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/Packages/postgresql10-10.17-1PGDG.rhel7.x86_64.rpm --output /tmp/postgres/postgresql10-10.17-1PGDG.rhel7.x86_64.rpm
  58. curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/Packages/postgresql10-contrib-10.17-1PGDG.rhel7.x86_64.rpm --output /tmp/postgres/postgresql10-contrib-10.17-1PGDG.rhel7.x86_64.rpm
  59. curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/Packages/postgresql10-debuginfo-10.17-1PGDG.rhel7.x86_64.rpm --output /tmp/postgres/postgresql10-debuginfo-10.17-1PGDG.rhel7.x86_64.rpm
  60. curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/Packages/postgresql10-devel-10.17-1PGDG.rhel7.x86_64.rpm --output /tmp/postgres/postgresql10-devel-10.17-1PGDG.rhel7.x86_64.rpm
  61. curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/Packages/postgresql10-docs-10.17-1PGDG.rhel7.x86_64.rpm --output /tmp/postgres/postgresql10-docs-10.17-1PGDG.rhel7.x86_64.rpm
  62. curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/Packages/postgresql10-libs-10.17-1PGDG.rhel7.x86_64.rpm --output /tmp/postgres/postgresql10-libs-10.17-1PGDG.rhel7.x86_64.rpm
  63. curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/Packages/postgresql10-plpython-10.17-1PGDG.rhel7.x86_64.rpm --output /tmp/postgres/postgresql10-plpython-10.17-1PGDG.rhel7.x86_64.rpm
  64. curl https://dms-git.ameyo.net:8265/UpgradeOStoOracle/OracleLinux/raw/branch/master/Packages/postgresql10-server-10.17-1PGDG.rhel7.x86_64.rpm --output /tmp/postgres/postgresql10-server-10.17-1PGDG.rhel7.x86_64.rpm
  65. yum localinstall -y /tmp/postgres/postgres*
  66. sed -i '89 s/exit 1/PGDATA=\/var\/lib\/pgsql\/10\/data\//' /usr/pgsql-10/bin/postgresql-10-setup
  67. /usr/pgsql-10/bin/postgresql-10-setup initdb
  68. sed -i s/ident/trust/g /var/lib/pgsql/10/data/pg_hba.conf
  69. sed -i s/peer/trust/g /var/lib/pgsql/10/data/pg_hba.conf
  70. sed -i "/listen_addresses/i \ listen_addresses='*' " /var/lib/pgsql/10/data/postgresql.conf
  71. ####################################################################