#!/bin/bash
# (C) Copyright 2012,2013 Continuent, Inc - Released under the New BSD License
# Version 1.0.5 - 2013-04-03

[ -z "$VERBOSE" ]  && export VERBOSE=1
export VALIDATE_ONLY=1
cookbook_dir=$(dirname $0)

CURRENT_TOPOLOGY=$cookbook_dir/../CURRENT_TOPOLOGY 
if [ -f $CURRENT_TOPOLOGY ]
then
    echo "There is already a topology installed : `cat $CURRENT_TOPOLOGY`"
    echo "The purpose of this script is to check the cluster before installation "
    echo "to make sure that you can install"
    echo ""
    echo "Syntax: [VERBOSE=2] $0"
    echo ""
    echo "If VERBOSE=2 is used, you will get all the gory details of what Tungsten is checking"
    exit 1
fi


if [ -x $cookbook_dir/install_master_slave ]
then
    $cookbook_dir/install_master_slave
else
    echo "$cookbook_dir/install_master_slave not found or not executable"
    exit 1
fi

