#!/bin/bash
# IBM Confidential
# OCO Source Materials
# 5724-V51
#
# (c) Copyright IBM Corp. 2000, 2008 All Rights Reserved.
#
# The source code for this program is not published or otherwise
# divested of its trade secrets, irrespective of what has been
# deposited with the U.S. Copyright Office.
# 
# # Copyright (c) 2000, 2004 IBM Corp. - All Rights Reserved.
# # IBM makes no representations or warranties about the suitability of
# # this program, either express or implied, including but not limited to
# # the implied warranties of merchantability, fitness for a particular
# # purpose, or non-infringement. 
# 
#



. ${TOP}/bin/get_params.sh

printUsage()
{
    ${ECHO} "USAGE: migrateToInstalledFP.sh --fromversion=<fromversion>"
    ${ECHO} "fromversion:- BASE, FP1, IF1, FP2, FP3, FP4, FP5, IF2, FP6, IF3, IF4" 
    exit 0
}

if [[ $# != 1 ]]
then
    printUsage
fi

FROMVERSION=`${ECHO} $1 |${CUT} -d "=" -f2`;export FROMVERSION
FROMVERSION=`${ECHO} ${FROMVERSION}| ${TR} 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
export FROMVERSION

if [ "${FROMVERSION}" != "BASE" ] && [ "${FROMVERSION}" != "FP1" ] && [ "${FROMVERSION}" != "IF1" ] && [ "${FROMVERSION}" != "FP2" ]  && [ "${FROMVERSION}" != "FP3" ] && [ "${FROMVERSION}" != "FP4" ] && [ "${FROMVERSION}" != "FP5" ] && [ "${FROMVERSION}" != "IF2" ] && [ "${FROMVERSION}" != "FP6" ] && [ "${FROMVERSION}" != "IF3" ] && [ "${FROMVERSION}" != "IF4" ]; then
        ${ECHO} "WRONG fromversion"
        printUsage
fi
 


$JAVA_RT com.ibm.ccd.common.db.LocalizedShellScriptRunner "${SHELL} migrateToInstalledFP_localized.sh $@" "$TOP/bin/migration"
