--- install-supercell-2.2 2013-09-12 17:05:29.380152544 +0200 +++ install-supercell-2.2-new 2013-10-04 12:34:28.440948662 +0200 @@ -4,29 +4,47 @@ V="2.2" if [ -z "$1" ] then - REL="C" + REL="C" else - REL="$1" + REL="$1" fi # Collect some information. ARCH=`arch` +OSVERS=`rpm -qa \*-release|grep -Ei "^oracle|^redhat|^centos"| cut -d"-" -f3` # Get release arch. if [ "$ARCH" = "i686" ] then RELEASE_ARCH="i386" - echo "===============================================================" - echo "WARNING!! YOU ARE INSTALLING THE ASTIUM ON A 32-BITS CENTOS. " - echo "ASTIUM 2.2 IS ONLY SUPPORTED ON 64-BITS CENTOS 6 !!! " - echo "===============================================================" - sleep 5 - exit + + if [ "$OSVERS" = "6" ] + then + echo "===============================================================" + echo "WARNING!! YOU ARE INSTALLING THE ASTIUM ON A 32-BITS CENTOS. " + echo "ASTIUM 2.2 IS ONLY SUPPORTED ON 64-BITS CENTOS 6 !!! " + echo "===============================================================" + sleep 5 + exit + fi else RELEASE_ARCH="x86_64" + + if [ "$OSVERS" = "5" ] + then + echo "===============================================================" + echo "WARNING!! YOU ARE INSTALLING THE 64-BITS VERSION OF ASTIUM. " + echo "THIS VERSION IS UNSUPPORTED AND WILL PROBABLY NOT WORK." + echo "" + echo "THIS INSTALL WILL CONTINUE AT YOUR OWN RISK. WE WILL NOT ANSWER" + echo "QUESTIONS ABOUT PROBLEMS WITH THE 64-BIT VERSION" + echo "===============================================================" + sleep 5 + fi fi REPASTIUM="ftp://yum.astium.nl/pub/dist/Supercell/$V/CentOS6/intorrent/$REL/$RELEASE_ARCH/os" +REPNEONOVA="ftp://yum.neonova.nl/pub/dist/Neonova-CentOS/2.0/CentOS5/neonova/A/$RELEASE_ARCH/os" echo "" echo "Installing Supercell $V $REL $ARCH, please wait...." @@ -34,9 +52,9 @@ if selinuxenabled then - echo "Please set SELINUX=disabled in /etc/sysconfig/selinux." - echo "Then REBOOT and try installing again." - exit 1 + echo "Please set SELINUX=disabled in /etc/sysconfig/selinux." + echo "Then REBOOT and try installing again." + exit 1 fi ifconfig eth0 > /dev/null 2>&1 @@ -59,14 +77,33 @@ yum -y install libzip.i686 libstdc++.i686 fi -# install yum-priorities -yum -y install yum-priorities +# On centos6 install yum-priorities +if [ "$OSVERS" = "6" ] +then + yum -y install yum-priorities +fi -# Now, install the NeoNova repository files, and the Supercell kernel: -wget $REPASTIUM/CentOS/supercell-release-$V-*.noarch.rpm -rpm -Uvh supercell-release-$V-*.noarch.rpm -wget $REPASTIUM/Neonova/RPMS/supercell-repo-$V-*.noarch.rpm -rpm -Uvh supercell-repo-$V-*.noarch.rpm +# On centos5 install yum-priorities and tftp-server. +if [ "$OSVERS" = "5" ] +then + # install yum-priorities + yum -y install yum-priorities + rpm -Uvh $REPNEONOVA/Neonova/RPMS/yum-priorities-*.noarch.rpm + + # temp because of bug in CentOS 5.7, they dropped tftp-server from their repos + yum -y install xinetd + rpm -Uvh ftp://yum.astium.nl/pub/tftp-server-0.49-2.el5.centos.$RELEASE_ARCH.rpm +fi + +# Now, install the Supercell repository files: +rpm -Uvh $REPASTIUM/CentOS/supercell-release-$V-*.noarch.rpm +rpm -Uvh $REPASTIUM/intorrent/RPMS/supercell-repo-$V-*.noarch.rpm + +# On centos5 also install the neonova repository. +if [ "$OSVERS" = "5" ] +then + rpm -Uvh $REPNEONOVA/Neonova/RPMS/neonova-centos-release-2.0-*.noarch.rpm +fi # clean yum cache yum clean metadata @@ -74,17 +111,28 @@ # Update CentOS. yum -y update +# install fail2ban on centos5. +if [ "$OSVERS" = "5" ] +then + wget http://download.fedoraproject.org/pub/epel/5/$RELEASE_ARCH/epel-release-5-4.noarch.rpm + rpm -Uvh epel-release-5-4.noarch.rpm + yum --enablerepo epel install -y fail2ban +fi + # if postgresql /var/lib/pgsql/ does not exists, init postgreSQL. -if [ ! -d /var/lib/pgsql/data ] +if [ "$OSVERS" = "6" ] then - if [ ! -d /var/lib/pgsql ] - then - yum -y install postgresql-server - fi - test=`/sbin/service postgresql 2>&1|grep initdb` - if [ -n "$test" ] + if [ ! -d /var/lib/pgsql/data ] then - /sbin/service postgresql initdb + if [ ! -d /var/lib/pgsql ] + then + yum -y install postgresql-server + fi + test=`/sbin/service postgresql 2>&1|grep initdb` + if [ -n "$test" ] + then + /sbin/service postgresql initdb + fi fi fi