Changeset 8086


Ignore:
Timestamp:
10/08/12 07:58:05 (8 years ago)
Author:
pjkersha
Message:

Fix for get trust roots script - replaced sed with awk call to re-insert carriage returns for base 64 decoding.

Location:
trunk/MyProxyWebService/myproxy/ws/client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MyProxyWebService/myproxy/ws/client/myproxy-ws-get-trustroots-wget.sh

    r8082 r8086  
    114114for i in $entries; do 
    115115    filename=${i%%=*} 
    116     filecontent="$(echo ${i#*=}|sed -e "s/.\{65\}/&\n/g"|openssl enc -d -base64)" 
     116    filecontent="$(echo ${i#*=}|awk '{for(i=1;i<length;i+=65) print substr($0,i,65)}'|openssl enc -d -base64)" 
    117117    echo "$filecontent" > $cadir/$filename 
    118118done 
  • trunk/MyProxyWebService/myproxy/ws/client/myproxy-ws-get-trustroots.sh

    r8085 r8086  
    1 #!/bin/bash 
     1#!/bin/bash  
    22# 
    33# Client script for web service interface to MyProxy get-trustroots based on  
     
    5151 
    5252# Set-up destination trust root directory 
    53 if [ $cadir ]; then 
    54     if [ ! -d $cadir ]; then 
    55         mkdir -p $cadir 
    56     fi 
     53if [ -z $cadir ]; then 
     54    if [ ${X509_CERT_DIR} ]; then 
     55        cadir=${X509_CERT_DIR} 
    5756     
    58 elif [ ${X509_CERT_DIR} ]; then 
    59     cadir=${X509_CERT_DIR} 
    60      
    61 elif [ "$LOGNAME" = "root" ]; then 
    62     cadir=/etc/grid-security/certificates 
    63      
    64     # Check path exists and if not make it 
    65     if [ ! -d "/etc/grid-security" ]; then 
    66         mkdir /etc/grid-security 
    67     fi 
    68         
    69     if [ ! -d "/etc/grid-security/certificates" ]; then 
    70         mkdir /etc/grid-security/certificates 
    71     fi 
    72 else 
    73     cadir=${HOME}/.globus/certificates 
    74      
    75     # Check path exists and if not make it 
    76     if [ ! -d "${HOME}/.globus" ]; then 
    77         mkdir ${HOME}/.globus 
    78     fi 
    79      
    80     if [ ! -d "${HOME}/.globus/certificates" ]; then 
    81         mkdir ${HOME}/.globus/certificates 
     57    elif [ "$LOGNAME" = "root" ]; then 
     58        cadir=/etc/grid-security/certificates 
     59    else 
     60        cadir=${HOME}/.globus/certificates 
    8261    fi 
    8362fi 
     63 
     64# Make the directory path if it doesn't already exist 
     65if [ ! -d $cadir ]; then 
     66    mkdir -p $cadir 
     67fi 
     68 
    8469 
    8570# Set peer authentication based on bootstrap command line setting 
     
    10489for i in $entries; do 
    10590    filename=${i%%=*} 
    106     filecontent="$(echo ${i#*=}|sed -e "s/.\{65\}/&\n/g"|openssl enc -d -base64)" 
     91    filecontent="$(echo ${i#*=}|awk '{for(i=1;i<length;i+=65) print substr($0,i,65)}'|openssl enc -d -base64)" 
    10792    echo "$filecontent" > $cadir/$filename 
    10893done 
Note: See TracChangeset for help on using the changeset viewer.