fi
if [ $flags == "bigclient" ]; then
- flags="client"
+ flags="client"
fi
# if we are in a state where we are generating proxies (${CA_DIR}/serial_proxy.txt exists)
#define all used dirs
TARGETDIR=$1
-MODULEDIR=$(cd $(dirname $0)/..; pwd)
-CONFIGDIR=$MODULEDIR/test
+CONFIGDIR=$(cd $(dirname $0)/..; echo $PWD)/test
export PASSWORD='changeit'
DAYS=10000
exit -1
fi
-mkdir -p $TARGETDIR
-
-# check the certificate directory...
-
-X509_CERT_DIR=${TARGETDIR}/grid-security/certificates
-
-if [ ! -d $X509_CERT_DIR ]
-then
- mkdir -p $X509_CERT_DIR
+if [ ! -d "$TARGETDIR" ]; then
+ mkdir -p $TARGETDIR
fi
-[ "$ONLYENV" = 'yes' ] || echo "Certificate directory set to $X509_CERT_DIR"
-
cd $TARGETDIR
-[ "$ONLYENV" = 'yes' ] || echo "Current directory now: $PWD"
-[ "$ONLYENV" = 'yes' ] || echo "Config directory now: ${CONFIGDIR}"
+# set it to an absolute path
+TARGETDIR=$PWD
+[ "$ONLYENV" = 'yes' ] || echo "Target directory: ${TARGETDIR}"
+[ "$ONLYENV" = 'yes' ] || echo "Config directory: ${CONFIGDIR}"
-tmpdir=$PWD/tmp
+tmpdir=$TARGETDIR/tmp
mkdir -p $tmpdir
trap "rm -rf $tmpdir" EXIT
-ABSTARGETDIR=$PWD
for catype in $CATYPES; do
echo "+-----------------------"
echo "| $catype"
echo "+-----------------------"
- cd $ABSTARGETDIR
+ cd $TARGETDIR
export CATYPE=${catype}
export CA_DIR=${catype}-ca
echo "CA directory already exists: $CA_DIR"
else
cp -a $CONFIGDIR/${catype}-ca $CA_DIR
- result=$?
- if [ $result -ne 0 ];then
- echo The copying of CA ${catype} failed with error code $result
- exit -1
- fi
+ result=$?
+ if [ $result -ne 0 ];then
+ echo The copying of CA ${catype} failed with error code $result
+ exit -1
+ fi
fi
if [ $catype != "fake" ]
if [ -d $X509_CERT_DIR ]
then
cp $CA_DIR/${catype}.cert $X509_CERT_DIR/${hash_number}.0
- result=$?
- if [ $result -ne 0 ];then
- echo "The copying of ${CA_DIR}/${catype}.cert to \
- $X509_CERT_DIR/${hash_number}.0 failed with error code $result";
- fi
+ result=$?
+ if [ $result -ne 0 ];then
+ echo "The copying of ${CA_DIR}/${catype}.cert to \
+ $X509_CERT_DIR/${hash_number}.0 failed with error code $result";
+ fi
cp $tmpdir/temporary_signing_policy.file $X509_CERT_DIR/${hash_number}.signing_policy
- result=$?
- if [ $result -ne 0 ];then
- echo "The copying of $tmpdir/temporary_signing_policy.file to \
- $X509_CERT_DIR/${hash_number}.signing_policy failed with error code $result";
- fi
+ result=$?
+ if [ $result -ne 0 ];then
+ echo "The copying of $tmpdir/temporary_signing_policy.file to \
+ $X509_CERT_DIR/${hash_number}.signing_policy failed with error code $result";
+ fi
rm $tmpdir/temporary_signing_policy.file
else
echo "The standard globus directory $X509_CERT_DIR does not exist!";
[ "$ONLYENV" = 'yes' ] || echo "Easy usage environmental variable settings:"
-echo "export X509_CERT_DIR=$ABSTARGETDIR/grid-security/certificates"
-echo "export X509_USER_CERT=$ABSTARGETDIR/home/usercert.pem"
-echo "export X509_USER_KEY=$ABSTARGETDIR/home/userkey.pem"
+echo "export X509_CERT_DIR=$TARGETDIR/grid-security/certificates"
+echo "export X509_USER_CERT=$TARGETDIR/home/usercert.pem"
+echo "export X509_USER_KEY=$TARGETDIR/home/userkey.pem"
if [ "$VOMS" = 'yes' ]; then
- echo "export VOMSDIR=$ABSTARGETDIR/grid-security/vomsdir"
+ echo "export VOMSDIR=$TARGETDIR/grid-security/vomsdir"
fi