############################## main ################################
-# check the certificate directory...
-
-if [ -! -z $X509_CERT_DIR ]
-then
- echo "Certificate directory set to $X509_CERT_DIR";
-else
- X509_CERT_DIR="/etc/grid-security/certificates";
- echo "Certificate directory set to $X509_CERT_DIR";
-fi
if [ "$1" == "--all" ]; then
CATYPES='trusted fake big expired'
ALL='yes'
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
+fi
+echo "Certificate directory set to $X509_CERT_DIR";
+
cd $TARGETDIR
echo "Current directory now: `pwd`"
echo "Config directory now: ${CONFIGDIR}"