#!/bin/sh
############################################################################################
# Name : /public/scripts/cp2win
# Purpose : A script to copy product files (classes) from Unix host to Windows
# installation host
# By : Yariv Sheizaf
# Date : 08-Jan-2002
# Argumnets :
# 1 - configuration name
############################################################################################
if [ "$USER" != "cmadm" -a "$USER" != "yariv" ]
then
echo ""
echo "$0 should be run with user cmadm or yariv. Exit..."
echo ""
exit 1
fi
HOSTN=`hostname`
if [ "$HOSTN" != "PRO2K-SEPHI" ]
then
echo ""
echo "$0 should be run from host PRO2K-SEPHI. Exit..."
echo ""
exit 1
fi
## Define servers
WINSRVR="PRO2K-SEPHI"
if [ $# -lt 1 ]
then
echo "Usage: $0 configuration-name"
echo "Example: $0 prd_2.0"
exit 1
fi
CNFNAME=$1
## Check configuration existing in P4 DB
ISCNF="n"
for i in `p4 dirs //Globecom/\* | awk -F/ '{print $NF}'`
do
if [ "$i" = "$CNFNAME" ]
then
ISCNF="y"
fi
done
if [ "$ISCNF" = "n" ]
then
echo ""
echo $CNFNAME" is not a valid configuration. Exit..."
echo ""
exit 1
fi
UNIXDRIVE=/cygdrive/f
WINDRIVE=/cygdrive/o
UNIXHOME=$UNIXDRIVE"/home/cmadm"
WRKROOTDIR=$WINDRIVE"/Globecom/"$CNFNAME"/Globecom"
INSDIR=$UNIXDRIVE"/"$CNFNAME"/ins"
if [ ! -d $INSDIR ]
then
echo ""
echo $INSDIR" is not exist. Exit..."
echo ""
exit 1
fi
## Synchronize CI files
CIDIR=$WRKROOTDIR"/CI"
if [ ! -d $CIDIR ]
then
echo ""
echo $CIDIR" is not exist. Exit..."
echo ""
exit 1
fi
rm -rf $CIDIR/classes
cp -r $INSDIR/CI/classes $CIDIR
echo ""
exit 0