#!/bin/bash
# 
# Configuration script to set up and remove replication services on 
# Tungsten Replicator services.  You must run configure first followed by 
# this script. 
#
# Copyright (c) 2011 Continuent, Inc.  All rights reserved.

# Check for ruby.  
RUBY=`which ruby 2> /dev/null`
if [ "$RUBY" = "" -o ! -x "$RUBY" ]; then
  echo "Your system does not appear to have a ruby interpreter installed"
  echo "Please install ruby and ensure that 'ruby --version' works"
  exit 1
fi

# Set home and cd to it to ensure consistent working directory. 
THOME=`dirname $0`
cd $THOME

# Run the installation with appropriate include for Ruby install files. 
$RUBY -Iruby -Iruby/lib ruby/configure.rb --notice --package ConfigureServicePackage $*