Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Installation

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-13-2009, 10:54 PM
Intermediate Member
 
Posts: 20
Default Simple Bash script for server preperation CentOS.

This simple script will do basic things such as set a hostname, the ZCS license, the hosts file, and download extract and start the zimbra installer on CentOS.

Hosts file should be in same directory as hosts.conf
License should be in same directory as license.xml

Code:
if [[ $EUID -ne 0 ]]; then
   echo -e "\e[1;31mThis script must be run as root or it will fail\e[0m" 1>&2
   exit 1
fi

echo "Zimbra Auto Server Preperation Script 1.0"
echo " "
echo "---"
echo "This script will prepare this server for Zimbra 6.0.2, and will start the installation. Please read the documentation!"
echo ""
echo -e "\e[1;32mYes will be assumed to answers, and will be defaulted. 'n' or 'no' will result in a No answer, anything else will be a yes.\e[0m"
echo ""
echo -e "\e[1;31mThis script MUST be run as root or it will fail\e[0m"
echo "---"
echo "Start Installation? (Y/n)"
read start

if [ $start == "n" ] || [ $start == "no" ]; then
echo "Exiting..."
exit 1
fi

# Check if the OS matches Red hat or CentOS
OS=`cat /etc/redhat-release | awk {'print $1}'`
if [ "$OS" != "CentOS" ]
then
echo -e "\e[1;31mSystem runs on something other than CentOS. This may not work!\e[0m";
echo -e "\e[1;31mContinue Anyway? (y/n)\e[0m"
read cont
if [ $cont == "n" ] || [ $cont == "no"]; then
echo "Exiting..."
exit 1
fi

fi

echo -e "\e[1;32mOkay. Vee one. Do not go back now.\e[0m"
echo -e "\e[1;33m-----------------------!!!-----------------------\e[0m"
echo "Updating System..."
yum update * -y > yum_update.log
echo "Installing Prerequisites..."
yum install wget gmp compat-libstdc++-33 sysstat libidn sudo -y > yum_prerequisite.log

echo -e "\e[1;31mWhat should the hostname be of this machine?\e[0m"
read host
hostname $host
echo "Hostname set. Continuing..."
echo "Downloading Zimbra..."
cd /tmp
echo -e "\e[1;31mVersion of Zimbra? [Network Edition (Needs license) or Free open source software (Foss)] (N/F)\e[0m"
read version
if [ $version == "F" ]; then
echo "FOSS Version selected"
wget http://h.yimg.com/lo/downloads/6.0.4_GA/zcs-6.0.4_GA_2038.RHEL5.20091214191028.tgz > wget_zcs.log
fi
if [ $version == "N" ]; then
echo "Network version selected"
wget http://h.yimg.com/lo/downloads/6.0.4_GA/zcs-NETWORK-6.0.4_GA_2038.RHEL5.20091214172206.tgz > wget_zcs.log
fi
echo "Extracting & Cleaning up..."
tar xfz zcs* > tar_zcs.log
rm -rf zcs*tgz > rm_zcs.log

echo "Cleaned up. If you select to continue at this point, you will be handed over to the Zimbra installation wizard, and this wizard will exit."
echo "---"
echo -e "\e[1;31mContinue? (Y/n)\e[0m"
read conti
if [ $conti == "n" ] || [ $conti == "no" ]; then
echo "Exiting..."
exit 1
fi
echo "Setting hosts and license."
cp hosts.conf /etc/hosts
cp license.xml /etc/ZCSLicense.xml
cd zcs*
echo "Copied. Rotation. Here comes Zimbra."
sh install.sh --platform-override -l /etc/ZCSLicense.xml

Last edited by Tux.Ice; 01-10-2010 at 09:01 AM..
Reply With Quote
  #2 (permalink)  
Old 11-16-2009, 02:11 AM
Special Member
 
Posts: 107
Default

Thanks man.
Reply With Quote
  #3 (permalink)  
Old 01-10-2010, 09:02 AM
Intermediate Member
 
Posts: 20
Default Updated

Updated for CentOS 5.4 and Zimbra 6.0.4 GA.
Reply With Quote
  #4 (permalink)  
Old 01-10-2010, 10:27 AM
Moderator
 
Posts: 7,911
Default

You could also check if iptables and selinux have been disabled ?
__________________
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.