#!/bin/sh
############################################################################################
# Name : /public/scripts/PinsMkdir
# Purpose : A script to create directories tree of /public/<version>/ins
# Should be run as first step of Globecom build.
# By : Yariv Sheizaf
# Date : 09-Sep-2001
# Argumnets :
# 1 - configuration name
############################################################################################
if [ "$USER" != "root" ]
then
echo ""
echo "$0 should be run with user root. Exit..."
echo ""
exit 1
fi
HOSTN=`hostname`
if [ "$HOSTN" != "tavola" ]
then
echo ""
echo "$0 should be run from host tavola. Exit..."
echo ""
exit 1
fi
## Define servers
SUNSRVR="tavola"
if [ $# -lt 1 ]
then
echo "Usage: $0 configuration-name"
echo "Example: $0 prd_2.0"
exit 1
fi
CNFNAME=$1
CNFDIR="/public/"$CNFNAME
PRVCNFDIR="/public/"$$.$CNFNAME
if [ -d $CNFDIR ]
then
mv $CNFDIR $PRVCNFDIR
fi
mkdir $CNFDIR
CNFINSDIR=$CNFDIR"/ins"
mkdir $CNFINSDIR
for i in `cat /public/scripts/pinsdirs`
do
mkdir -p $CNFINSDIR/$i
done
chown -R cmadm $CNFDIR
chgrp -R staff $CNFDIR
chmod -R 777 $CNFDIR
echo ""
echo $CNFDIR" empty tree created ...."
echo "Previous build tree is: "$PRVCNFDIR
echo ""
exit 0