From: Akos Frohner Date: Mon, 22 May 2006 09:23:03 +0000 (+0000) Subject: Whitespace changes and variable name rationalization. X-Git-Tag: glite-security-test-utils_R_1_6_0~14 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=1283abd6b494af609ee34e9d9cfb819d007c87b6;p=glite-security-test-utils.git Whitespace changes and variable name rationalization. --- diff --git a/bin/generate-test-certificates.sh b/bin/generate-test-certificates.sh index a038c8b..c80ed7f 100755 --- a/bin/generate-test-certificates.sh +++ b/bin/generate-test-certificates.sh @@ -40,7 +40,7 @@ function create_cert { 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) @@ -641,8 +641,7 @@ done #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 @@ -652,32 +651,24 @@ if [ -z "$TARGETDIR" ]; then 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 @@ -705,11 +696,11 @@ for catype in $CATYPES; do 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" ] @@ -729,17 +720,17 @@ for catype in $CATYPES; do 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!"; @@ -758,10 +749,10 @@ done [ "$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