You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ma...@apache.org on 2013/08/21 09:13:06 UTC

git commit: Removed temporary files in Stratos installer

Updated Branches:
  refs/heads/master c71457c08 -> 5057a0c0c


Removed temporary files in Stratos installer

Signed-off-by: Manula Thantriwatte <ma...@wso2.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/5057a0c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/5057a0c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/5057a0c0

Branch: refs/heads/master
Commit: 5057a0c0c8b7413cd0df16268cd4743b51efd919
Parents: c71457c
Author: Imesh Gunaratne <im...@wso2.com>
Authored: Tue Aug 20 20:51:56 2013 +0530
Committer: Manula Thantriwatte <ma...@wso2.com>
Committed: Wed Aug 21 12:42:31 2013 +0530

----------------------------------------------------------------------
 tools/stratos-installer/LICENSE.txt~            |   4 -
 tools/stratos-installer/README.txt~             |  66 --
 tools/stratos-installer/clean.sh~               | 112 ---
 tools/stratos-installer/conf/setup.conf~        | 198 -----
 tools/stratos-installer/ec2-cartridge-setup.sh~ |  39 -
 tools/stratos-installer/imageupload.sh~         | 101 ---
 .../openstack-cartridge-setup.sh~               | 123 ---
 tools/stratos-installer/setup.sh~               | 836 -------------------
 tools/stratos-installer/start-servers.sh~       | 149 ----
 9 files changed, 1628 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5057a0c0/tools/stratos-installer/LICENSE.txt~
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/LICENSE.txt~ b/tools/stratos-installer/LICENSE.txt~
deleted file mode 100644
index c62cd25..0000000
--- a/tools/stratos-installer/LICENSE.txt~
+++ /dev/null
@@ -1,4 +0,0 @@
-This product is licensed by WSO2 Inc. under Apache License 2.0. The license
-can be downloaded from the following locations:
-	http://www.apache.org/licenses/LICENSE-2.0.html
-	http://www.apache.org/licenses/LICENSE-2.0.txt

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5057a0c0/tools/stratos-installer/README.txt~
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/README.txt~ b/tools/stratos-installer/README.txt~
deleted file mode 100644
index 4afe592..0000000
--- a/tools/stratos-installer/README.txt~
+++ /dev/null
@@ -1,66 +0,0 @@
-Apahe Stratos version 3.0.0
----------------------------------
-
-20th August 2013
-Welcome to the Apache Stratos 3.0.0
-
-
-Important
-----------------------------------------
-
-Apache Stratos could be installed on a single node or on multiple nodes. If you are installing on
-multiple nodes copy stratos_installer to each node and update configuration parameters in conf/setup.conf accordingly.
-
-
-How to install
-----------------------------------------
-
-1. Install following prerequisites:
-
-    java    -jdk1.6.x
-    git
-    facter
-    zip
-    mysql-server
-    Gitblits    
-
-2. Build Apache Stratos from source:
-
-   git clone https://git-wip-us.apache.org/repos/asf/incubator-stratos.git
-   cd incubator-stratos
-   mvn clean install
-
-3. Copy cloud controller, stratos controller, elb, agent and cli packages to a folder inside stratos_installer. May be this could be called "stratos_installer/packages":
-    
-   apache-stratos-cc-<version>.zip 
-   apache-stratos-sc-<version>.zip
-   apache-stratos-elb-<version>.zip   
-   apache-stratos-agent-<version>.zip
-   apache-stratos-cli-<version>.zip    
-  
-4. Download MySql Java connector from http://dev.mysql.com/downloads and copy the jar file to the above packages folder.
-
-5. Create and download the keys from IaaSs and store them on a secure location.
-
-6. If Apache Stratos being setup in multiple nodes open up the security rules in IaaSs for the following ports (defined in ./conf/setup.conf)
-   22, 443, 8280, 4103, 4100, agent_https_port, agent_http_port, elb_port, agent_clustering_port, sc_cluster_port, elb_cluster_port,
-   cassandra_port, stratos_db_port and userstore_db_port.
-
-7. Prepare cartridge images and upload them to the IaaSs. Please refer Apache Stratos documentation for more information on creating cartridge images.
-
-8. Update ./conf/setup.conf and configure parameters. 
-
-9. Run setup.sh as root to install.
-
-    E.g -
-    sudo JAVA_HOME=<java-home-path> ./setup.sh -p"<product-list>"
-    <product-list> could be defined as "cc sc elb agent" or any other combination according to the deployment configuration.
-
-    If you need to clean the setup
-    clean.sh
-    E.g. -
-    sudo ./clean.sh -a<host-name> -b<host-username> -c<mysql-username> -d<mysql-password>
-
----------------------------------------------------------------------------
-Thanks for using Apache Stratos
-Apache Stratos Team

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5057a0c0/tools/stratos-installer/clean.sh~
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/clean.sh~ b/tools/stratos-installer/clean.sh~
deleted file mode 100755
index 8554091..0000000
--- a/tools/stratos-installer/clean.sh~
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-# ----------------------------------------------------------------------------
-#
-# This script is for cleaning the host machine where one or more of the Stratos servers are run.
-# Make sure the user is running as root.
-# ----------------------------------------------------------------------------
-
-
-if [ "$UID" -ne "0" ]; then
-	echo ; echo "  You must be root to run $0.  (Try running 'sudo bash' first.)" ; echo 
-	exit 69
-fi
-
-function help {
-    echo ""
-    echo "Clean the host machine where one or more of the Stratos2 servers are run."
-    echo "usage:"
-    echo "clean.sh -a<hostname> -b<stratos user name> -c<mysql user name> -d<mysql user password>"
-    echo ""
-}
-
-while getopts a:b:c:d: opts
-do
-  case $opts in
-    a)
-        hostname=${OPTARG}
-        ;;
-    b)
-        host_user=${OPTARG}
-        ;;
-    c)
-        mysql_user=${OPTARG}
-        ;;
-    d)
-        mysql_pass=${OPTARG}
-        ;;
-    *)
-        help
-        exit 1
-        ;;
-  esac
-done
-
-function helpclean {
-    echo ""
-    echo "usage:"
-    echo "clean.sh -a<hostname> -b<stratos username> -c<mysql username> -d<mysql password>"
-    echo ""
-}
-
-function clean_validate {
-
-if [[ ( -z $hostname || -z $host_user || -z $mysql_user || -z $mysql_pass ) ]]; then
-    helpclean
-    exit 1
-fi
-}
-
-clean_validate
-
-if [[ -d /home/git ]]; then
-    deluser git
-    rm -fr /home/git
-fi
-mysql -u $mysql_user -p$mysql_pass -e "DROP DATABASE IF EXISTS stratos_foundation;"
-mysql -u $mysql_user -p$mysql_pass -e "DROP DATABASE IF EXISTS userstore;"
-#mysql -u $mysql_user -p$mysql_pass -e "DROP DATABASE IF EXISTS billing;"
-
-killall java
-sleep 15
-rm -rf $stratos_path/*
-rm -rf $log_path/*
-#rm -f /home/$host_user/.ssh/id_rsa
-
-#remove contents of upload folder
-if [[ -d /home/$host_user/upload ]]; then
-    rm -f /home/$host_user/upload/*
-fi
-
-#clean /etc/hosts
-KEYWORD='git.'
-if grep -Fxq "$KEYWORD" /etc/hosts
-then
-    cat /etc/hosts | grep -v "$KEYWORD" > /tmp/hosts
-    mv /tmp/hosts /etc/hosts
-fi
-
-#if grep -Fxq "$hostname" /etc/hosts
-#then
-#    cat /etc/hosts | grep -v "$hostname" > /tmp/hosts
-#    mv /tmp/hosts /etc/hosts
-#fi
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5057a0c0/tools/stratos-installer/conf/setup.conf~
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/conf/setup.conf~ b/tools/stratos-installer/conf/setup.conf~
deleted file mode 100644
index a14c6b2..0000000
--- a/tools/stratos-installer/conf/setup.conf~
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-# ----------------------------------------------------------------------------
-#
-#  Server configuration script for Apache Stratos
-# ----------------------------------------------------------------------------
-#
-#  Configure below parameters to install Apache Stratos using ../setup.sh.
-#  General configuration parameters are mandatory and other sections are optional. Configure each section on each node where
-#  Stratos product is installed.
-#
-# ----------------------------------------------------------------------------
-
-
-# General configuration
-# ----------------------------------------------------------------------------
-export setup_path= #Folder path containing stratos_setup
-export stratos_pack_path= #Folder path containing stratos packages 
-export stratos_path= #Folder which stratos will be installed
-
-export resource_path=$setup_path/resources
-export script_path=$setup_path/scripts
-export log_path=/var/log/apache-stratos
-export hostip="ip" #Machine ip on which setup script run
-export host_user="" #A host user account for stratos. If not provided deafult is assumed stratos. If no account #named stratos exist it will be created.
-export mysql_connector_jar=$stratos_pack_path/"mysql-connector-java-5.1.25.jar" #mysql connector jar file name
-
-
-# SC configuration
-# ----------------------------------------------------------------------------
-export sc_path=$stratos_path/"apache-stratos-sc-3.0.0-SNAPSHOT"
-export sc_pack=$stratos_pack_path/"apache-stratos-sc-3.0.0-SNAPSHOT.zip"
-#export lib_path="/opt/lib"
-#export script_path="/opt/scripts"
-#export resource_path="/opt/resources"
-
-export stratos2_domain="stratos.apache.org"
-
-export userstore_db_hostname="stratos.apache.org"
-export userstore_db_schema="userstore"
-export userstore_db_port="3306"
-export userstore_db_user="root"
-export userstore_db_pass="mysql"
-
-export s_foundation_db_hostname="stratos.apache.org"
-export s_foundation_db_schema="stratos_foundation"
-export s_foundation_db_port="3306"
-export s_foundation_db_user="root"
-export s_foundation_db_pass="mysql"
-
-export sc_https_port="9445"
-export sc_http_port="9765"
-export sc_port_offset=2
-export sc_hostname="stratos.apache.org"
-export elb_ip=$hostip
-export cassandra_port="9163"
-export sc_ip=$hostip
-export agent_ip=$hostip
-
-
-# Billing configuration
-# ----------------------------------------------------------------------------
-
-#export billing_db_hostanme="stratos.apache.org"
-#export billing_db_username="root"
-#export billing_db_password="root"
-#export billing_db_port="3306"
-#export billing_db_schema="billing"
-
-
-# Git repo cofiguration. This will be needed only if you need to setup an internal git repo.
-# ----------------------------------------------------------------------------
-export git_user="git"
-export email="git@stratos.apache.org"
-export git_hostname="stratos.apache.org"
-export git_ip=$hostip
-export axis2c_path="axis2c-1.6.2"
-export axis2c_pack="axis2-1.6.2-bin.zip"
-
-
-# CC configuration
-# ----------------------------------------------------------------------------
-
-export cc_path=$stratos_path/"apache-stratos-cc-3.0.0-SNAPSHOT"
-export cc_pack=$stratos_pack_path/"apache-stratos-cc-3.0.0-SNAPSHOT.zip"
-
-export cc_https_port="9444"
-export mb_listen_port="5673"
-export cc_port_offset=1
-export cc_hostname="stratos.apache.org"
-export mb_cassandra_host="localhost"
-export mb_cassandra_port="9161"
-
-
-# ELB configuration
-# ----------------------------------------------------------------------------
-
-export elb_path=$stratos_path/"apache-stratos-elb-3.0.0-SNAPSHOT"
-export elb_pack=$stratos_pack_path/"apache-stratos-elb-3.0.0-SNAPSHOT.zip"
-export elb_hostname="stratos.apache.org"
-export enable_autoscaler=true
-export enable_embedded_autoscaler=false
-export elb_port_offset=0
-export elb_port="9443"
-
-
-# Agent configuration
-# ----------------------------------------------------------------------------
-
-export agent_path=$stratos_path/"apache-stratos-agent-3.0.0-SNAPSHOT"
-export agent_pack=$stratos_pack_path/"apache-stratos-agent-3.0.0-SNAPSHOT.zip"
-export agent_clustering_port="4025"
-export agent_hostname="stratos.apache.org"
-export agent_http_port="9767"
-export agent_https_port="9447"
-export agent_port_offset=4
-
-
-# BAM configuration
-# ----------------------------------------------------------------------------
-#export bam_port_offset=3
-#export bam_port="9446"
-#export bam_ip=$hostip
-#export bam_reciever_port="7614"
-#export bam_reciever_secured_port="7714"
-#export bam_hostname="stratos.apache.org"
-#export bam_path="wso2bam-2.3.0"
-#export bam_pack="wso2bam-2.3.0.zip"
-
-
-# IaaS Providers
-# ----------------------------------------------------------------------------
-# EC2
-#export ec2_provider_enable=false
-#export ec2_identity=""
-#export ec2_credential=""
-#export ec2_keypair=""
-#export ec2_scaleup_order=1
-#export ec2_scaledown_order=2
-#export ec2_availability_zone="us-east-1c"
-#export ec2_security_groups="manager,cep,mb,default"
-#export ec2_instance_type="m1.large"
-#export ec2_image_id=""
-
-# Openstack
-export openstack_provider_enable=true
-export openstack_identity="stratos:stratos" # Openstack project name:Openstack login user
-export openstack_credential="password" # Openstack login password
-export openstack_tenant="stratos" # openstack project name
-export openstack_project_id=$openstack_tenant
-export openstack_jclouds_endpoint="http://10.100.0.30:5000/"
-export openstack_scaleup_order=2
-export openstack_scaledown_order=3
-
-export openstack_keypair_name="key-pair-name" #Name of the openstack key pair. The name should match
-#<property name="keyPair" value="key-pair-name"/> under Openstack provider in cartridge xml files
-
-export openstack_image_id="RegionOne/" #No need to change this as of now
-export nova_region="RegionOne"
-export openstack_instance_type_tiny="RegionOne\/1"
-export openstack_instance_type_small="RegionOne\/2"
-export openstack_security_group="security-group-name"
-export php_cartridge_image_id=""
-export mysql_cartridge_image_id=""
-export tomcat_cartridge_image_id=""
-
-
-# Cassandra configuration
-# ----------------------------------------------------------------------------
-export cassandra_port1=9160
-export cassandra_port2=7000
-
-# Hadoop configuration
-# ----------------------------------------------------------------------------
-export hadoop_port1=5140
-export hadoop_port2=9000
-
-export sc_cluster_port="5001"
-export elb_cluster_port="4000"
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5057a0c0/tools/stratos-installer/ec2-cartridge-setup.sh~
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/ec2-cartridge-setup.sh~ b/tools/stratos-installer/ec2-cartridge-setup.sh~
deleted file mode 100644
index a23b7e5..0000000
--- a/tools/stratos-installer/ec2-cartridge-setup.sh~
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-# ----------------------------------------------------------------------------
-#
-#  This script is for setting up Apache Stratos Cartridges for EC2.
-# ----------------------------------------------------------------------------
-
-# Die on any error:
-set -e
-
-SLEEP=60
-export LOG=$log_path/stratos-ec2-cartridge-setup.log
-
-source "./conf/setup.conf"
-
-
-if [[ ! -d $log_path ]]; then
-    mkdir -p $log_path
-fi
-   
-echo 'TODO: To be written'

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5057a0c0/tools/stratos-installer/imageupload.sh~
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/imageupload.sh~ b/tools/stratos-installer/imageupload.sh~
deleted file mode 100755
index 282af4d..0000000
--- a/tools/stratos-installer/imageupload.sh~
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-# ----------------------------------------------------------------------------
-#
-#  This script is for publishing vm images to the cloud environment (IaaS).
-# ----------------------------------------------------------------------------
-
-TMPAREA=/tmp/__upload
-
-# Process Command Line
-while getopts a:p:t:C:x:y:z:n:w: opts
-do
-  case $opts in
-    a)
-        ADMIN=${OPTARG}
-        ;;
-    p)
-        PASSWORD=${OPTARG}
-        ;;
-    t)
-        TENANT=${OPTARG}
-        ;;
-    C)
-        ENDPOINT=${OPTARG}
-        ;;
-    x)
-        ARCH=${OPTARG}
-        ;;
-    y)
-        DISTRO=${OPTARG}
-        ;;
-    z)
-        ARCHFILE=${OPTARG}
-        ;;
-    n)
-        IMAGENAME=${OPTARG}
-        ;;
-    w)
-        VERSION=${OPTARG}
-        ;;
-    *)
-        echo "Syntax: $(basename $0) -u USER -p KEYSTONE -t TENANT -C CONTROLLER_IP -x ARCH -y DISTRO -w VERSION -z ARCHFILE -n IMAGENAME"
-        exit 1
-        ;;
-  esac
-done
-
-IMAGE=`basename $ARCHFILE`
-EXTENSION="${IMAGE##*.}"
-
-# You must supply the API endpoint
-if [[ ! $ENDPOINT ]]
-then
-        echo "Syntax: $(basename $0) -a admin -p PASSWORD -t TENANT -C CONTROLLER_IP"
-        exit 1
-fi
-
-
-
-mkdir -p ${TMPAREA}
-if [ ! -f ${TMPAREA}/${IMAGE} ]
-then
-        cp ${ARCHFILE} ${TMPAREA}/${IMAGE}
-fi
-
-if [ -f ${TMPAREA}/${IMAGE} ]
-then
-	cd ${TMPAREA}
-    if [[ ${EXTENSION} == "gz" || ${EXTENSION} == "tgz" ]]; then
-	    tar zxf ${IMAGE}
-	    DISTRO_IMAGE=$(ls *.img)
-	elif [[ ${EXTENSION} == "img" ]]; then
-	    DISTRO_IMAGE=${IMAGE}
-    fi
-
-	AMI=$(glance -I ${ADMIN} -K ${PASSWORD} -T ${TENANT} -N http://${ENDPOINT}:5000/v2.0 add name="${IMAGENAME}" disk_format=ami container_format=ami distro="${DISTRO} ${VERSION}" kernel_id=${KERNEL} is_public=true < ${DISTRO_IMAGE} | awk '/ ID/ { print $6 }')
-
-	echo "${DISTRO} ${VERSION} ${ARCH} now available in Glance (${AMI})"
-
-	rm -f /tmp/__upload/*{.img,-vmlinuz-virtual,loader,floppy}
-else
-	echo "Tarball not found!"
-fi

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5057a0c0/tools/stratos-installer/openstack-cartridge-setup.sh~
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/openstack-cartridge-setup.sh~ b/tools/stratos-installer/openstack-cartridge-setup.sh~
deleted file mode 100755
index c652a0d..0000000
--- a/tools/stratos-installer/openstack-cartridge-setup.sh~
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-# ----------------------------------------------------------------------------
-#
-#  This script is invoked by setup.sh for setting up Apache Stratos Cartridges for OpenStack.
-# ----------------------------------------------------------------------------
-
-# Die on any error:
-set -e
-
-SLEEP=60
-export LOG=$log_path/stratos-openstack-cartridge-setup.log
-
-source "./conf/setup.conf"
-
-if [[ ! -d $log_path ]]; then
-    mkdir -p $log_path
-fi
-   
-#mkdir -p /var/www/notify
-#cp -f ./resources/notify.php /var/www/notify/index.php
-#echo "apache2 will be restarted and if start successfull you configuration upto this point is OK." >> $LOG
-#echo "apache2 will be restarted and if start successfull you configuration upto this point is OK."
-#apachectl stop
-#sleep 5
-#apachectl start
-
-echo "Creating payload directory ... " | tee $LOG
-if [[ ! -d $cc_path/repository/resources/payload ]]; then
-   mkdir -p $cc_path/repository/resources/payload
-fi
-
-echo "Creating cartridges directory ... " | tee $LOG
-if [[ ! -d $cc_path/repository/deployment/server/cartridges/ ]]; then
-   mkdir -p $cc_path/repository/deployment/server/cartridges/
-fi
-
-
-# Copy the cartridge specific configuration files into the CC
-if [ "$(find ./cartridges/ -type f)" ]; then
-    cp -vf ./cartridges/*.xml $cc_path/repository/deployment/server/cartridges/
-fi
-if [ "$(find ./cartridges/payload/ -type f)" ]; then
-    cp -vf ./cartridges/payload/*.txt $cc_path/repository/resources/payload/
-fi
-if [ "$(find ./cartridges/services/ -type f)" ]; then
-    cp -vf ./cartridges/services/*.xml $cc_path/repository/deployment/server/services/
-fi
-
-pushd $cc_path
-echo "Updating repository/deployment/server/cartridges/mysql.xml" | tee $LOG
-# <iaasProvider type="openstack" >
-#    <imageId>nova/d6e5dbe9-f781-460d-b554-23a133a887cd</imageId>
-#    <property name="keyPair" value="stratos-demo"/>
-#    <property name="instanceType" value="nova/1"/>
-#    <property name="securityGroups" value="default"/>
-#    <!--<property name="payload" value="resources/as.txt"/>-->
-# </iaasProvider>
- 
-
-cp -vf repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$openstack_keypair_name\"/>@g" > repository/deployment/server/cartridges/mysql.xml
-
-cp -vf repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$openstack_instance_type_tiny\"/>@g" > repository/deployment/server/cartridges/mysql.xml
-
-cp -vf repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@<property name=\"securityGroup\" value=\"*.*\"/>@<property name=\"securityGroup\" value=\"$openstack_security_group\"/>@g" > repository/deployment/server/cartridges/mysql.xml
-
-cp -vf repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$mysql_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/mysql.xml
-
-cp -vf repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos2_domain@g" > repository/deployment/server/cartridges/mysql.xml
-
-
-
-echo "Updating repository/deployment/server/cartridges/php.xml" | tee $LOG
-# <iaasProvider type="openstack" >
-#     <imageId>nova/250cd0bb-96a3-4ce8-bec8-7f9c1efea1e6</imageId>
-#     <property name="keyPair" value="stratos-demo"/>
-#     <property name="instanceType" value="nova/1"/>
-#     <property name="securityGroups" value="default"/>
-#     <!--<property name="payload" value="resources/as.txt"/>-->
-# </iaasProvider>
-
-cp -vf repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$openstack_keypair_name\"/>@g" > repository/deployment/server/cartridges/php.xml
-
-cp -vf repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$openstack_instance_type_tiny\"/>@g" > repository/deployment/server/cartridges/php.xml
-
-cp -vf repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<property name=\"securityGroup\" value=\"*.*\"/>@<property name=\"securityGroup\" value=\"$openstack_security_group\"/>@g" > repository/deployment/server/cartridges/php.xml
-
-#cp -f repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-#cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$php_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/php.xml
-
-cp -vf repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$php_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/php.xml
-
-cp -vf repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos2_domain@g" > repository/deployment/server/cartridges/php.xml
-
-popd # cc_path

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5057a0c0/tools/stratos-installer/setup.sh~
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/setup.sh~ b/tools/stratos-installer/setup.sh~
deleted file mode 100755
index 948f5cf..0000000
--- a/tools/stratos-installer/setup.sh~
+++ /dev/null
@@ -1,836 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-# ----------------------------------------------------------------------------
-#
-#  Server configuration script for Apache Stratos
-# ----------------------------------------------------------------------------
-
-# Die on any error:
-set -e
-
-# This script will setup the Stratos2.
-
-SLEEP=60
-
-source "./conf/setup.conf"
-export LOG=$log_path/stratos.log
-
-cc="false"
-elb="false"
-agent="false"
-sc="false"
-#bam="false"
-demo="openstack"
-product_list="cc;elb;agent;sc"
-enable_internal_git=false
-
-function help {
-    echo ""
-    echo "demo means you will setup a demo server of S2 in a single physical machine which has Openstack installed."
-    echo "This demo server include all S2 related packs."
-    echo "usage:"
-    echo "setup.sh -u<host user name> -d<demo> -p\"<product list>\""
-    echo "eg."
-    echo "sudo JAVA_HOME=/opt/jdk1.6.0_24 ./setup.sh -dopenstack -p\"cc elb\""
-    echo "sudo JAVA_HOME=/opt/jdk1.6.0_24 ./setup.sh -dopenstack -p\"all\""
-    echo ""
-    echo "-d: <demo name> whether you need to run demo for ec2 or openstack. The value is one of ec2|openstack. By default no demo is setup"
-    echo "-p: <product list> Give one or more of the servers to be setup in this machine. The available servers are"
-    echo "-g: <enable_internal_git true|false> Whether enable internal git repo for Stratos2. Default is false"
-    echo "    cc, elb, agent, sc or all. 'all' means you need to setup all servers in this machine. Default is all"
-    echo ""
-}
-
-while getopts p:d:g: opts
-do
-  case $opts in
-    p)
-        product_list=${OPTARG}
-        echo $product_list
-        ;;
-    d)
-        demo=${OPTARG}
-        echo $demo
-        ;;
-    g)
-        enable_internal_git=${OPTARG}
-        echo $enable_internal_git
-        ;;
-    *)
-        help
-        exit 1
-        ;;
-  esac
-done
-
-arr=$(echo $product_list | tr " " "\n")
-
-for x in $arr
-do
-    if [[ $x = "cc" ]]; then
-        cc="true"
-    fi
-    if [[ $x = "elb" ]]; then
-        elb="true"
-    fi
-    if [[ $x = "agent" ]]; then
-        agent="true"
-    fi
-    if [[ $x = "sc" ]]; then
-        sc="true"
-    fi
-#   if [[ $x = "bam" ]]; then
-#       bam="true"
-#   fi
-    if [[ $x = "all" ]]; then
-        cc="true"
-        elb="true"
-        agent="true"
-        sc="true"
-#       bam="true"
-    fi
-done
-product_list=`echo $product_list | sed 's/^ *//g' | sed 's/ *$//g'`
-if [[ -z $product_list || $product_list = "" ]]; then
-    help
-    exit 1
-fi
-
-function helpsetup {
-    echo ""
-    echo "Set up the environment variables correctly in conf/setup.conf"
-    echo ""
-}
-
-echo "user provided in conf/setup.conf is $host_user. If you want to provide some other user name please specify it at the prompt."
-echo "If you want to continue with the $host_user just press enter to continue"
-read username
-if [[ $username != "" ]]; then
-    host_user=$username
-fi
-user=`id $host_user`
-if [[ $? = 1 ]]; then
-    echo "User $host_user does not exist. The system will create it."
-    adduser --home /home/$host_user $host_user
-fi
-
-echo "StrictHostKeyChecking no" > /home/$host_user/.ssh/config
-chmod 600 /home/$host_user/.ssh/config
-chown $host_user:$host_user /home/$host_user/.ssh/config
-export $enable_internal_git
-export $host_user
-export hostname=`hostname -f`
-
-function setup_validate {
-    
-
-if [[ -z $hostname ]]; then
-    echo "Set up the hostname of the node"
-    exit 1
-fi
-
-if [[ -z $userstore_db_hostname ]]; then
-    userstore_db_hostname=""
-fi
-if [[ -z $sc_hostname ]]; then
-    sc_hostname=$hostname
-fi
-if [[ -z $s_foundation_db_hostname ]]; then
-    s_foundation_db_hostname=$hostname
-fi
-if [[ -z $agent_hostname ]]; then
-    agent_hostname=$hostname
-fi
-if [[ -z $cc_hostname ]]; then
-    cc_hostname=$hostname
-fi
-if [[ -z $git_hostname ]]; then
-    git_hostname=$hostname
-fi
-if [[ -z $nova_controller_hostname ]]; then
-    nova_controller_hostname=$hostname
-fi
-if [[ -z $bam_hostname ]]; then
-    bam_hostname=$hostname
-fi
-if [[ -z $elb_hostname ]]; then
-   elb_hostname=$hostname
-fi
-
-
-if [[ ( -z $hostip ) ]]; then
-    hostip=$(ifconfig eth0| sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
-    if [[ ( -z $hostip ) ]]; then
-        helpsetup
-        exit 1
-    fi
-fi
-
-if [[ -z $git_ip ]]; then
-    git_ip=$hostip
-fi
-
-if [[ $sc = "true" ]]; then
-
-    if [[ $enable_internal_git = "true" ]]; then
-        if [[ -z $git_user ]]; then
-            echo "Please specify the git user, because it will be needed to create an internal git repo"
-        fi
-        if [[ -z $axis2c_path ]]; then
-            echo "Please specify the path to Axis2/C binary, because it will be needed to create an internal git repo"
-        fi
-
-        echo "$hostip    git.$stratos2_domain" >> /etc/hosts
-
-    fi
-
-    if [[ ( -z $email|| -z $s_foundation_db_user || -z $s_foundation_db_pass || -z $hostname
-        || -z $sc_path ) ]]; then
-        helpsetup
-        exit 1
-    fi
-fi
-
-if [[ $cc = "true" ]]; then
-    if [[ ( -z $hostname || -z $cc_path ) ]]; then
-        helpsetup
-        exit 1
-    fi
-fi
-
-if [[ $elb = "true" ]]; then
-    if [[ ( -z $hostname || -z $elb_path ) ]]; then
-        helpsetup
-        exit 1
-    fi
-fi
-
-if [[ $agent = "true" ]]; then
-    if [[ ( -z $hostname || -z $agent_path ) ]]; then
-        helpsetup
-        exit 1
-    fi
-fi
-
-if [[ ! -f $mysql_connector_jar ]]; then
-    echo "Please copy the mysql connector jar into the same folder as this command(stratos2 release pack folder) and update conf/setup.conf file"
-    exit 1
-fi
-
-if [[ ! -d $JAVA_HOME ]]; then
-    echo "Please set the JAVA_HOME environment variable for the running user"
-    exit 1
-fi
-export JAVA_HOME=$JAVA_HOME
-
-
-if [[ $openstack_provider_enable = "true" ]]; then
-    if [[ ( -z $openstack_identity || -z $openstack_credential || -z $openstack_jclouds_endpoint ) ]]; then
-        helpsetup
-        exit 1
-    fi
-
-fi
-
-if [[ $ec2_provider_enable = "true" ]]; then
-    if [[ ( -z $ec2_identity || -z $ec2_credential || -z $ec2_keypair ) ]]; then
-        helpsetup
-        exit 1
-    fi
-fi
-
-}
-
-setup_validate
-
-# Make sure the user is running as root.
-if [ "$UID" -ne "0" ]; then
-	echo ; echo "  You must be root to run $0.  (Try running 'sudo bash' first.)" ; echo 
-	exit 69
-fi
-
-if [[ ! -d $log_path ]]; then
-    mkdir -p $log_path
-fi
-
-echo ""
-echo "For all the questions asked while during executing the script please just press the enter button"
-echo ""
-
-
-if [[ $sc = "true" ]]; then
-    if [[ ! -d $resource_path ]]; then
-        cp -rf ./resources $stratos_path
-    fi
-
-    if [[ ! -d $script_path ]]; then
-        cp -rf ./scripts $stratos_path
-    fi
-
-    if [[ ! -d $sc_path ]]; then
-        unzip $sc_pack -d $stratos_path
-    fi
-    #if [[ ! -d $axis2c_path ]]; then
-      #  unzip $axis2c_pack -d $stratos_path
-    #fi
-fi
-if [[ $elb = "true" ]]; then
-    if [[ ! -d $elb_path ]]; then
-        unzip $elb_pack -d $stratos_path
-    fi
-fi
-if [[ $cc = "true" ]]; then
-    if [[ ! -d $cc_path ]]; then
-        unzip $cc_pack -d $stratos_path
-    fi
-fi
-if [[ $agent = "true" ]]; then
-    if [[ ! -d $agent_path ]]; then
-        unzip $agent_pack -d $stratos_path
-    fi
-fi
-
-if [[ $bam = "true" ]]; then
-    if [[ ! -d $bam_path ]]; then
-        unzip $bam_pack -d $stratos_path
-    fi
-fi
-
-
-if [[ $sc = "true" ]]; then
-    ##
-#    mysql -u${userstore_db_user} -p${userstore_db_pass} -e "GRANT ALL PRIVILEGES ON *.* TO '${userstore_db_user}'@'%'   IDENTIFIED BY '${userstore_db_pass}' WITH GRANT OPTION;flush privileges;"
-
-
-    # Setup SC
-    #--------------------------------------------------
-    echo "Setup SC" >> $LOG
-    echo "Configuring SC"
-
-    cp -f ./config/sc/repository/conf/cartridge-config.properties $sc_path/repository/conf/
-    cp -f ./config/sc/repository/conf/carbon.xml $sc_path/repository/conf/
-    cp -f ./config/sc/repository/conf/axis2/axis2.xml $sc_path/repository/conf/axis2
-    cp -f ./config/sc/bin/stratos.sh $sc_path/bin/
-    cp -fr ./config/sc/repository/resources/user-data/* $sc_path/repository/resources/user-data/
-    cp -f ./config/sc/repository/conf/datasources/master-datasources.xml $sc_path/repository/conf/datasources/
-    cp -f ./config/sc/repository/conf/datasources/stratos-datasources.xml $sc_path/repository/conf/datasources/
-    cp -f $mysql_connector_jar $sc_path/repository/components/lib/
-    cp -f ./config/sc/repository/conf/log4j.properties  $sc_path/repository/conf/
-    cp -f ./config/sc/repository/conf/etc/logging-config.xml  $sc_path/repository/conf/etc/
-    pushd $sc_path
-
-    echo "Set mb hostname and mb port in bin/stratos.sh." >> $LOG
-    cp -f ./bin/stratos.sh bin/stratos.sh.orig
-    cat bin/stratos.sh.orig | sed -e "s@CC_HOSTNAME:MB_LISTEN_PORT@$cc_hostname:$mb_listen_port@g" > bin/stratos.sh
-
-    echo "Change CC hostname in repository/conf/cartridge-config.properties" >> $LOG
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@CC_HOSTNAME:CC_HTTPS_PORT@$cc_hostname:$cc_https_port@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@AGENT_HOSTNAME:AGENT_PORT@$agent_ip:$agent_https_port@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@STRATOS_DOMAIN@$stratos2_domain@g" > repository/conf/cartridge-config.properties
-
-    if [[ $enable_internal_git = "true" ]]; then
-        cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-        cat repository/conf/cartridge-config.properties.orig | sed -e "s@GIT_IP@$git_ip@g" > repository/conf/cartridge-config.properties
-    fi
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@SC_HOSTNAME:SC_HTTPS_PORT@$sc_ip:$sc_https_port@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@s_foundation_db_HOSTNAME:s_foundation_db_PORT@$s_foundation_db_hostname:$s_foundation_db_port@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@s_foundation_db_USER@$s_foundation_db_user@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@s_foundation_db_PASS@$s_foundation_db_pass@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@s_foundation_db_SCHEMA@$s_foundation_db_schema@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@CC_HOSTNAME:MB_LISTEN_PORT@$cc_hostname:$mb_listen_port@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@ELB_IP@$elb_ip@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@BAM_IP@$bam_ip@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@BAM_PORT@$bam_port@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@SCRIPT_PATH@$script_path@g" > repository/conf/cartridge-config.properties
-
-    cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@HOST_USER@$host_user@g" > repository/conf/cartridge-config.properties
-
-    echo "Change mysql password in repository/conf/datasources/master-datasources.xml" >> $LOG
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_HOSTNAME@$userstore_db_hostname@g" > repository/conf/datasources/master-datasources.xml
-
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_PORT@$userstore_db_port@g" > repository/conf/datasources/master-datasources.xml
-
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_SCHEMA@$userstore_db_schema@g" > repository/conf/datasources/master-datasources.xml
-
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_USER@$userstore_db_user@g" > repository/conf/datasources/master-datasources.xml
-
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_PASS@$userstore_db_pass@g" > repository/conf/datasources/master-datasources.xml
-
-    echo "Change mysql password in repository/conf/datasources/master-datasources.xml" >> $LOG
-    cp -f repository/conf/datasources/stratos-datasources.xml repository/conf/datasources/stratos-datasources.xml.orig
-    cat repository/conf/datasources/stratos-datasources.xml.orig | sed -e "s@BILLING_DB_HOSTNAME@$billing_db_hostanme@g" > repository/conf/datasources/stratos-datasources.xml
-
-    cp -f repository/conf/datasources/stratos-datasources.xml repository/conf/datasources/stratos-datasources.xml.orig
-    cat repository/conf/datasources/stratos-datasources.xml.orig | sed -e "s@BILLING_DB_PORT@$billing_db_port@g" > repository/conf/datasources/stratos-datasources.xml
-
-    cp -f repository/conf/datasources/stratos-datasources.xml repository/conf/datasources/stratos-datasources.xml.orig
-    cat repository/conf/datasources/stratos-datasources.xml.orig | sed -e "s@BILLING_DB_SCHEMA@$billing_db_schema@g" > repository/conf/datasources/stratos-datasources.xml
-
-    cp -f repository/conf/datasources/stratos-datasources.xml repository/conf/datasources/stratos-datasources.xml.orig
-    cat repository/conf/datasources/stratos-datasources.xml.orig | sed -e "s@BILLING_USERNAME@$billing_db_username@g" > repository/conf/datasources/stratos-datasources.xml
-
-    cp -f repository/conf/datasources/stratos-datasources.xml repository/conf/datasources/stratos-datasources.xml.orig
-    cat repository/conf/datasources/stratos-datasources.xml.orig | sed -e "s@BILLING_PASSWORD@$billing_db_password@g" > repository/conf/datasources/stratos-datasources.xml
-    
-    cp -f repository/conf/axis2/axis2.xml repository/conf/axis2/axis2.xml.orig
-    cat repository/conf/axis2/axis2.xml.orig | sed -e "s@SC_HOSTNAME@${sc_hostname}@g" > repository/conf/axis2/axis2.xml
-    
-    cp -f repository/conf/axis2/axis2.xml repository/conf/axis2/axis2.xml.orig
-    cat repository/conf/axis2/axis2.xml.orig | sed -e "s@SC_CLUSTER_PORT@${sc_cluster_port}@g" > repository/conf/axis2/axis2.xml
-    
-    cp -f repository/conf/carbon.xml repository/conf/carbon.xml.orig
-    cat repository/conf/carbon.xml.orig | sed -e "s@SC_PORT_OFFSET@${sc_port_offset}@g" > repository/conf/carbon.xml
-    
-    cp -f repository/conf/log4j.properties repository/conf/log4j.properties.orig
-    cat repository/conf/log4j.properties.orig | sed -e "s@BAM_HOSTNAME:BAM_RECEIVER_PORT@$bam_hostname:$bam_reciever_port@g" > repository/conf/log4j.properties
-
-    cp -f repository/conf/etc/logging-config.xml repository/conf/etc/logging-config.xml.orig
-    cat repository/conf/etc/logging-config.xml.orig | sed -e "s@BAM_HOSTNAME:CASSANDRA_PORT@$bam_hostname:$cassandra_port@g" > repository/conf/etc/logging-config.xml
-
-    popd # sc_path
-
-
-    # Database Configuration
-    # -----------------------------------------------
-    echo "Create and configure MySql Databases" >> $LOG
-
-    echo "Create userstore database"
-    mysql -u$userstore_db_user -p$userstore_db_pass < $resource_path/userstore.sql
-    #mysql -u$userstore_db_user -p$userstore_db_pass < $resource_path/registry.sql   #registry schema is only for AF
-    
-    echo "Create stratos_foundation database"
-    mysql -u$s_foundation_db_user -p$s_foundation_db_pass < $resource_path/stratos_foundation.sql
-
-    #mysql -u$billing_db_username -p$billing_db_password < $resource_path/billing-mysql.sql
-
-    #mysql -u$billing_db_username -p$billing_db_password < $resource_path/metering_mysql.sql
-
-    #Namespace Binding
-    # -----------------------------------------------
-    echo "bind Namespaces" >> $LOG
-    #apt-get install bind9 zip
-    #Copy the /db.stratos.com file into /etc/bind. Edit it as necessary
-    #cp -f ./resources/db.stratos.com $resource_path/db.$stratos2_domain
-    #echo "Set ELb Hostname in /etc/bind/db.stratos.com" >> $LOG
-    #cat $resource_path/db.$stratos2_domain | sed -e "s@SC_HOSTNAME@$sc_hostname@g" | sed -e "s@ELB_IP@$elb_ip@g" | sed -e "s@STRATOS_DOMAIN@$stratos2_domain@g" > /etc/bind/db.$stratos2_domain
-
-    #echo "Add the following content to /etc/bind/named.conf.local" >> $LOG
-    #echo "zone \"$stratos2_domain\" {" >> /etc/bind/named.conf.local
-    #echo "      type master;" >> /etc/bind/named.conf.local
-    #echo "      file \"/etc/bind/db.$stratos2_domain\";" >> /etc/bind/named.conf.local
-    #echo "};" >> /etc/bind/named.conf.local
-
-    #Copy https://svn.wso2.org/repos/wso2/scratch/hosting/build/tropos/resources/append_zone_file.sh into /opt/scripts folder
-    if [[ ! -d $stratos_path/scripts ]]; then
-        mkdir -p $stratos_path/scripts
-    fi
-    cp -f ./scripts/add_entry_zone_file.sh $stratos_path/scripts/add_entry_zone_file.sh
-    cp -f ./scripts/remove_entry_zone_file.sh $stratos_path/scripts/remove_entry_zone_file.sh
-
-
-    echo "End configuring the SC"
-fi #End SC server installation
-
-
-# Setup CC
-# ------------------------------------------------
-if [[ $cc = "true" ]]; then
-    echo "Setup CC" >> $LOG
-    echo "Configuring the Cloud Controller"
-    echo "Creating payload directory ... " >> $LOG
-    if [[ ! -d $cc_path/repository/resources/payload ]]; then
-        mkdir -p $cc_path/repository/resources/payload
-    fi
-
-    cp -f ./config/cc/bin/stratos.sh $cc_path/bin/
-    cp -f ./config/cc/repository/conf/cloud-controller.xml $cc_path/repository/conf/
-    cp -f ./config/cc/repository/conf/carbon.xml $cc_path/repository/conf/
-
-    #MB specific file copying
-    cp -f ./config/cc/repository/conf/advanced/qpid-virtualhosts.xml $cc_path/repository/conf/advanced/
-    #cp -f ./config/cc/repository/conf/carbon.xml $cc_path/repository/conf/
-    #End MB specific file copying
-
-    pushd $cc_path
-
-# Setup IaaS providers
-# ------------------------------------------------
-#        <iaasProviders>
-#        <!--iaasProvider type="ec2" name="ec2 specific details">
-#            <className>org.wso2.carbon.stratos.cloud.controller.iaases.AWSEC2Iaas</className>
-#                        <provider>aws-ec2</provider>
-#                        <identity svns:secretAlias="elastic.scaler.openstack.identity">dhsaghfdal</identity>
-#                        <credential svns:secretAlias="elastic.scaler.openstack.credential">jdkjaskd</credential>
-#                        <scaleUpOrder>1</scaleUpOrder>
-#                        <scaleDownOrder>2</scaleDownOrder>
-#                        <property name="jclouds.ec2.ami-query" value="owner-id=XX-XX-XX;state=available;image-type=machine"/>
-#            <property name="availabilityZone" value="us-east-1c"/>
-#                        <property name="securityGroups" value="manager,cep,mb,default"/>
-#            <property name="instanceType" value="m1.large"/>
-#            <property name="keyPair" value="nirmal-key"/>
-#                        <imageId>us-east-1/ami-52409a3b</imageId>
-#                </iaasProvider-->
-#                <iaasProvider type="openstack" name="openstack specific details">
-#            <className>org.wso2.carbon.stratos.cloud.controller.iaases.OpenstackNovaIaas</className>
-#                        <provider>openstack-nova</provider>
-#                        <identity svns:secretAlias="cloud.controller.openstack.identity">demo:demo</identity>
-#                        <credential svns:secretAlias="cloud.controller.openstack.credential">openstack</credential>
-#                        <property name="jclouds.endpoint" value="http://192.168.16.20:5000/" />
-#            <property name="jclouds.openstack-nova.auto-create-floating-ips" value="false"/>
-#                        <property name="jclouds.api-version" value="2.0/" />
-#                        <scaleUpOrder>2</scaleUpOrder>
-#                        <scaleDownOrder>3</scaleDownOrder>
-#                        <property name="X" value="x" />
-#                        <property name="Y" value="y" />
-#                        <imageId>nova/dab37f0e-cf6f-4812-86fc-733acf22d5e6</imageId>
-#                </iaasProvider>
-#        </iaasProviders>
-
-   echo "Set openstack provider specific info on repository/conf/cloud-controller.xml" >> $LOG
-
-   if [[ $ec2_provider_enable = "true" ]]; then
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_IDENTITY@$ec2_identity@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_CREDENTIAL@$ec2_credential@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SCALEUP_ORDER@$ec2_scaleup_order@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SCALEDOWN_ORDER@$ec2_scaledown_order@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_AVAILABILITY@$ec2_availability_zone@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SECURITY_GROUPS@$ec2_security_groups@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_INSTANCE_TYPE@$ec2_instance_type@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_KEYPAIR@$ec2_keypair@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_IMAGE_ID@$ec2_image_id@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@@g" > repository/conf/cloud-controller.xml
-   
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@MB_HOSTNAME@$cc_hostname@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@MB_LISTEN_PORT@$mb_listen_port@g" > repository/conf/cloud-controller.xml
-
-   fi
-
-    
-   echo "Set EC2 provider specific info on repository/conf/cloud-controller.xml" >> $LOG
-
-   if [[ $openstack_provider_enable = "true" ]]; then
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_IDENTITY@$openstack_identity@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_CREDENTIAL@$openstack_credential@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_ENDPOINT@$openstack_jclouds_endpoint@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_SCALEUP_ORDER@$openstack_scaleup_order@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_SCALEDOWN_ORDER@$openstack_scaledown_order@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_IMAGE_ID@$openstack_image_id@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
-
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@MB_HOSTNAME@$cc_hostname@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@MB_LISTEN_PORT@$mb_listen_port@g" > repository/conf/cloud-controller.xml
-
-   fi
-
-    cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-    cat repository/conf/cloud-controller.xml.orig | sed -e "s@CC_HOSTNAME:MB_LISTEN_PORT@$cc_hostname:$mb_listen_port@g" > repository/conf/cloud-controller.xml
-
-    echo "In repository/conf/carbon.xml"
-    cp -f repository/conf/carbon.xml repository/conf/carbon.xml.orig
-    cat repository/conf/carbon.xml.orig | sed -e "s@BAM_HOSTNAME:BAM_PORT@$bam_hostname:$bam_port@g" > repository/conf/carbon.xml
-
-    #Before starting CC we need to delete
-    #rm ./repository/conf/service-topology.conf
-    #rm ./repository/conf/service-topology.conf.back
-
-
-    # Setup MB
-    # -------------------------------------------------------------
-    echo "Setup MB" >> $LOG
-    echo "Set settings in cc/repository/conf/advanced/qpid-virtualhosts.xml" >> $LOG
-    cp -f repository/conf/advanced/qpid-virtualhosts.xml repository/conf/advanced/qpid-virtualhosts.xml.orig
-    cat repository/conf/advanced/qpid-virtualhosts.xml.orig | sed -e "s@MB_CASSANDRA_HOST@$mb_cassandra_host@g" > repository/conf/advanced/qpid-virtualhosts.xml
-    cp -f repository/conf/advanced/qpid-virtualhosts.xml repository/conf/advanced/qpid-virtualhosts.xml.orig
-    cat repository/conf/advanced/qpid-virtualhosts.xml.orig | sed -e "s@MB_CASSANDRA_PORT@$mb_cassandra_port@g" > repository/conf/advanced/qpid-virtualhosts.xml
-
-    echo "Set settings in cc/repository/conf/carbon.xml" >> $LOG
-    cp -f repository/conf/carbon.xml repository/conf/carbon.xml.orig
-    cat repository/conf/carbon.xml.orig | sed -e "s@CC_PORT_OFFSET@$cc_port_offset@g" > repository/conf/carbon.xml
-    #Before starting sc delete rm -rf tmp/ at mb root folder
-    rm -rf ./tmp
-
-
-    popd #cc_path
-    echo "End configuring the Cloud Controller"
-fi
-
-
-# Setup ELB
-# -------------------------------------------------------------    
-if [[ $elb = "true" ]]; then
-    echo "Setup ELB" >> $LOG
-    echo "Configuring the ELB"
-    cp -f ./config/elb/bin/stratos.sh $elb_path/bin/
-    cp -f ./config/elb/repository/conf/loadbalancer.conf $elb_path/repository/conf/
-    cp -f ./config/elb/repository/conf/axis2/axis2.xml $elb_path/repository/conf/axis2/
-    cp -f ./config/elb/repository/conf/datasources/master-datasources.xml $elb_path/repository/conf/datasources/
-    cp -f $mysql_connector_jar $elb_path/repository/components/lib/
-
-    pushd $elb_path
-    #If autoscaling enabled
-    echo "Set CC host and port in repository/conf/loadbalancer.conf" >> $LOG
-    # autoscaler_service_epr  https://CC_HOSTNAME:CC_PORT/services/CloudControllerService;
-    cp -f repository/conf/loadbalancer.conf repository/conf/loadbalancer.conf.orig
-    cat repository/conf/loadbalancer.conf.orig | sed -e "s@CC_HOSTNAME:CC_PORT@$cc_hostname:$cc_https_port@g" > repository/conf/loadbalancer.conf
-
-    cp -f repository/conf/loadbalancer.conf repository/conf/loadbalancer.conf.orig
-    cat repository/conf/loadbalancer.conf.orig | sed -e "s@ENABLE_AUTOSCALER@$enable_autoscaler@g" > repository/conf/loadbalancer.conf
-    
-    cp -f repository/conf/loadbalancer.conf repository/conf/loadbalancer.conf.orig
-    cat repository/conf/loadbalancer.conf.orig | sed -e "s@ENABLE_EMBEDDED_AUTOSCALER@$enable_embedded_autoscaler@g" > repository/conf/loadbalancer.conf
-
-    cp -f repository/conf/loadbalancer.conf repository/conf/loadbalancer.conf.orig
-    cat repository/conf/loadbalancer.conf.orig | sed -e "s@MB_HOSTNAME:MB_LISTEN_PORT@$cc_hostname:$mb_listen_port@g" > repository/conf/loadbalancer.conf
-
-    echo "Set hostname of the machine where elb run, in repository/conf/axis2/axis2.xml" >> $LOG
-    #<!--parameter name="localMemberHost">ELB_HOSTNAME</parameter-->
-    cp -f repository/conf/axis2/axis2.xml repository/conf/axis2/axis2.xml.orig
-    cat repository/conf/axis2/axis2.xml.orig | sed -e "s@ELB_HOSTNAME@$elb_hostname@g" > repository/conf/axis2/axis2.xml
-
-
-    echo "Set hostname of the machine where elb run, in repository/conf/etc/jmx.xml" >> $LOG
-    cp -f repository/conf/etc/jmx.xml repository/conf/etc/jmx.xml.orig
-    cat repository/conf/etc/jmx.xml.orig | sed -e "s@ELB_HOSTNAME@$elb_hostname@g" > repository/conf/etc/jmx.xml
-
-
-    echo "Change mysql password in repository/conf/datasources/master-datasources.xml" >> $LOG
-    cp -f ./repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_HOSTNAME@$userstore_db_hostname@g" | sed -e "s@USERSTORE_DB_PORT@$userstore_db_port@g"| sed -e "s@USERSTORE_DB_SCHEMA@$userstore_db_schema@g"|sed -e "s@USERSTORE_DB_USER@$userstore_db_user@g" |sed -e "s@USERSTORE_DB_PASS@$userstore_db_pass@g" > repository/conf/datasources/master-datasources.xml
-
-    popd #elb_path
-    echo "End configuring the ELB"
-fi
-
-
-# Setup Agent
-# -------------------------------------------------------------    
-if [[ $agent = "true" ]]; then
-    echo "Setup Agent" >> $LOG
-    echo "Configuring the Agent"
-    cp -f ./config/agent/repository/conf/agent.properties $agent_path/repository/conf/
-    cp -f ./config/agent/repository/conf/carbon.xml $agent_path/repository/conf/
-    pushd $agent_path
-
-    rm -rf registrants/
-
-    #Set agent host and ELb host in repository/conf/agent.properties.
-    #Note that loadBalancerDomain=wso2.carbon.lb.domain should be same as elb/repository/conf/axis2/axis2.xml
-    #<parameter name="domain">wso2.carbon.lb.domain</parameter>
-    echo "Set agent hostname in repository/conf/agent.properties." >> $LOG
-    cp -f ./repository/conf/agent.properties repository/conf/agent.properties.orig
-    cat repository/conf/agent.properties.orig | sed -e "s@AGENT_HOSTNAME@$agent_hostname@g" > repository/conf/agent.properties
-
-    cp -f ./repository/conf/agent.properties repository/conf/agent.properties.orig
-    cat repository/conf/agent.properties.orig | sed -e "s@AGENT_CLUSTERING_PORT@$agent_clustering_port@g" > repository/conf/agent.properties
-
-    echo "Set ELB hostname in repository/conf/agent.properties." >> $LOG
-    cp -f ./repository/conf/agent.properties repository/conf/agent.properties.orig
-    cat repository/conf/agent.properties.orig | sed -e "s@ELB_HOSTNAME@$elb_hostname@g" > repository/conf/agent.properties
-    
-    cp -f ./repository/conf/agent.properties repository/conf/agent.properties.orig
-    cat repository/conf/agent.properties.orig | sed -e "s@ELB_CLUSTER_PORT@$elb_cluster_port@g" > repository/conf/agent.properties
-
-    echo "Set SC_PATH in repository/conf/agent.properties." >> $LOG
-    cp -f ./repository/conf/agent.properties repository/conf/agent.properties.orig
-    cat repository/conf/agent.properties.orig | sed -e "s@SC_PATH@$sc_path@g" > repository/conf/agent.properties
-
-    echo "Set SC_HOST in repository/conf/agent.properties." >> $LOG
-    cp -f ./repository/conf/agent.properties repository/conf/agent.properties.orig
-    cat repository/conf/agent.properties.orig | sed -e "s@SC_HOSTNAME@$sc_hostname@g" > repository/conf/agent.properties
-
-    echo "Set SC_HTTPS_PORT in repository/conf/agent.properties." >> $LOG
-    cp -f ./repository/conf/agent.properties repository/conf/agent.properties.orig
-    cat repository/conf/agent.properties.orig | sed -e "s@SC_HTTPS_PORT@$sc_https_port@g" > repository/conf/agent.properties
-
-    cp -f repository/conf/carbon.xml repository/conf/carbon.xml.orig
-    cat repository/conf/carbon.xml.orig | sed -e "s@AGENT_PORT_OFFSET@${agent_port_offset}@g" > repository/conf/carbon.xml
-
-    popd #agent_path
-    echo "End configuring the Agent"
-fi
-
-
-# Setup BAM
-# --------------------------------------------------
-if [[ $bam = "true" ]]; then
- echo "Setup BAM" >> $LOG
- echo "Configuring the BAM"
- cp -f ./config/bam/bin/stratos.sh $bam_path/bin/
- cp -f ./config/bam/repository/conf/carbon.xml $bam_path/repository/conf/
- cp -f ./config/bam/repository/conf/etc/cassandra-component.xml $bam_path/repository/conf/etc/
- cp -f ./config/bam/repository/conf/etc/cassandra.yaml $bam_path/repository/conf/etc/
- cp -f ./config/bam/repository/conf/datasources/master-datasources.xml $bam_path/repository/conf/datasources/
- cp -f $mysql_connector_jar $bam_path/repository/components/lib/
-
-  pushd $bam_path
-
-  cp -f repository/conf/carbon.xml repository/conf/carbon.xml.orig
-  cat repository/conf/carbon.xml.orig | sed -e "s@BAM_PORT_OFFSET@${bam_port_offset}@g" > repository/conf/carbon.xml
-
-  cp -f repository/conf/etc/cassandra.yaml repository/conf/etc/cassandra.yaml.orig
-  cat repository/conf/etc/cassandra.yaml.orig | sed -e "s@BAM_HOSTNAME@${bam_hostname}@g" > repository/conf/etc/cassandra.yaml
-
-  cp -f repository/conf/etc/cassandra-component.xml repository/conf/etc/cassandra-component.xml.orig
-  cat repository/conf/etc/cassandra-component.xml.orig | sed -e "s@BAM_HOSTNAME:CASSANDRA_PORT@$bam_hostname:$cassandra_port@g" > repository/conf/etc/cassandra-component.xml
-
- echo "Change mysql password in repository/conf/datasources/master-datasources.xml" >> $LOG
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@BILLING_DB_HOSTNAME@$billing_db_hostanme@g" > repository/conf/datasources/master-datasources.xml
-
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@BILLING_DB_PORT@$billing_db_port@g" > repository/conf/datasources/master-datasources.xml
-
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@BILLING_DB_SCHEMA@$billing_db_schema@g" > repository/conf/datasources/master-datasources.xml
-
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@BILLING_USERNAME@$billing_db_username@g" > repository/conf/datasources/master-datasources.xml
-
-    cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
-    cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@BILLING_PASSWORD@$billing_db_password@g" > repository/conf/datasources/master-datasources.xml
-
- popd #bam_path
-fi
-
-# Configure cartridges
-# ---------------------------------------------------------
-if [[ $demo = "openstack" ]]; then
-   ./openstack-cartridge-setup.sh
-fi
-
-if [[ $demo = "ec2" ]]; then
-    ./ec2-cartridge-setup.sh
-fi
-
-# Starting the servers
-# ---------------------------------------------------------
-echo "Starting the servers" >> $LOG
-#Starting the servers in the following order is recommended
-#mb, cc, elb, is, agent, sc
-
-chown $host_user:$host_user -R $stratos_path/*
-
-echo "Starting up servers. This may take time. Look at $LOG file for server startup details"
-
-chown -R $host_user.$host_user $log_path
-chmod -R 777 $log_path
-
-export setup_dir=$PWD
-su - $host_user -c "export JAVA_HOME=$JAVA_HOME;source $setup_dir/conf/setup.conf;$setup_dir/start-servers.sh -p$product_list >> $LOG"
-
-echo "Servers started. Please look at $LOG file for server startup details"
-if [[ $sc == "true" ]]; then
-    echo "**************************************************************"
-    echo "Management Console : https://$HOSTNAME:$sc_https_port/"
-    echo "**************************************************************"
-fi
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5057a0c0/tools/stratos-installer/start-servers.sh~
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/start-servers.sh~ b/tools/stratos-installer/start-servers.sh~
deleted file mode 100755
index d136052..0000000
--- a/tools/stratos-installer/start-servers.sh~
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-# ----------------------------------------------------------------------------
-#
-# This script is for starting Apache Stratos servers.
-# ----------------------------------------------------------------------------
-
-# Die on any error:
-set -e
-product_list=$1
-export LOG=$log_path/stratos.log
-SLEEP=40
-
-if [[ -f ./conf/setup.conf ]]; then
-    source "./conf/setup.conf"
-fi
-
-function help {
-    echo ""
-    echo "Give one or more of the servers to start on this machine. The available servers are"
-    echo "cc, elb, agent, sc, all. 'all' means you need to start all servers."
-    echo "usage:"
-    echo "setup.sh -p\"<product list>\""
-    echo "eg."
-    echo "setup.sh -p\"cc elb\""
-    echo ""
-}
-
-while getopts p: opts
-do
-  case $opts in
-    p)
-        product_list=${OPTARG}
-        echo $product_list
-        ;;
-    *)
-        help
-        exit 1
-        ;;
-  esac
-done
-arr=$(echo $product_list | tr ";" "\n")
-
-for x in $arr
-do
-    if [[ $x = "cc" ]]; then
-        cc="true"
-    fi
-    if [[ $x = "elb" ]]; then
-        elb="true"
-    fi
-    if [[ $x = "agent" ]]; then
-        agent="true"
-    fi
-    if [[ $x = "sc" ]]; then
-        sc="true"
-    fi
-    if [[ $x = "all" ]]; then
-        cc="true"
-        elb="true"
-        agent="true"
-        sc="true"
-        bam="true"
-    fi
-    if [[ $x = "demo" ]]; then
-        demo="true"
-        cc="true"
-        elb="true"
-        agent="true"
-        sc="true"
-	bam="true"
-    fi
-done
-product_list=`echo $product_list | sed 's/^ *//g' | sed 's/ *$//g'`
-if [[ -z $product_list || $product_list = "" ]]; then
-    help
-    exit 1
-fi
-
-if [[ $bam = "true" ]]; then
-
-    echo ${bam_path}
-
-    echo "Starting BAM server ..." >> $LOG
-    nohup ${bam_path}/bin/stratos.sh -DportOffset=$bam_port_offset &
-    echo "BAM server started" >> $LOG
-    sleep $SLEEP
-
-fi
-
-if [[ $cc = "true" ]]; then
-    echo ${cc_path}
-
-    echo "Starting CC server ..." >> $LOG
-    nohup ${cc_path}/bin/stratos.sh -DportOffset=$cc_port_offset &
-    echo "CC server started" >> $LOG
-    sleep $SLEEP
-    sleep $SLEEP
-fi
-
-if [[ $elb = "true" ]]; then
-    echo ${elb_path} 
-
-    echo "Starting ELB server ..." >> $LOG
-    nohup ${elb_path}/bin/stratos.sh -DportOffset=$elb_port_offset &
-    echo "ELB server started" >> $LOG
-    sleep $SLEEP
-fi
-
-if [[ $agent = "true" ]]; then
-    echo ${agent_path}
-
-    echo "Starting AGENT server ..." >> $LOG
-    nohup ${agent_path}/bin/stratos.sh -DportOffset=$agent_port_offset &
-    echo "AGENT server started" >> $LOG
-    sleep $SLEEP
-fi
-
-
-if [[ $sc = "true" ]]; then
-    
-    echo ${sc_path}
-
-    echo "Starting SC server ..." >> $LOG
-    nohup ${sc_path}/bin/stratos.sh -DportOffset=$sc_port_offset &
-    echo "SC server started" >> $LOG
-    sleep $SLEEP
-
-fi
-
-