#!/bin/bash
# Licensed Materials - Property of IBM
# 5724-I68
#
# (C) Copyright IBM Corp. 2000, 2006
#
# US Government Users Restricted Rights - Use, duplication, or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.


. ${TOP}/bin/get_params.sh

printUsage()
{
	${ECHO} "USAGE: migrateToInstalledFP.sh --fromversion=<fromversion>"
 	${ECHO} "fromversion:- BASE, IF1, IF2, FP1, FP2, FP3, IF3, IF4, IF5, FP4, FP5, FP6, IF6, FP7, IF7, FP8, FP9, IF8, FP10, IF9"	
 	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}" != "IF1" ] && [ "${FROMVERSION}" != "IF2" ] && [ "${FROMVERSION}" != "FP1" ] && [ "${FROMVERSION}" != "FP2" ] && [ "${FROMVERSION}" != "FP3" ] && [ "${FROMVERSION}" != "IF3" ] && [ "${FROMVERSION}" != "IF4" ] && [ "${FROMVERSION}" != "IF5" ] && [ "${FROMVERSION}" != "FP4" ] && [ "${FROMVERSION}" != "FP5" ] && [ "${FROMVERSION}" != "FP6" ] && [ "${FROMVERSION}" != "IF6" ] && [ "${FROMVERSION}" != "FP7" ] && [ "${FROMVERSION}" != "IF7" ] && [ "${FROMVERSION}" != "FP8" ] && [ "${FROMVERSION}" != "FP9" ] && [ "${FROMVERSION}" != "IF8" ] && [ "${FROMVERSION}" != "FP10" ] && [ "${FROMVERSION}" != "IF9" ]; then
		${ECHO} "WRONG fromversion"
		printUsage
fi


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