]> WPIA git - nre.git/blobdiff - generateCRLs
upd: adjust duration of server certificates
[nre.git] / generateCRLs
index 0b2c14a79f9b425bd4652c024b3de08203961ac6..5d9089479769da99955586287f5e634489192da8 100755 (executable)
@@ -13,7 +13,7 @@ generateCRL() { # name, year, month
     echo CRL $1 $2-$3
     BASE="$PWD"
     pushd $1.ca > /dev/null
-    TZ=UTC LD_PRELOAD=`ls /usr/lib/*/faketime/libfaketime.so.1` FAKETIME="${year}-${month}-01 00:00:00" openssl ca -gencrl -config "$BASE/../selfsign.config" -keyfile key.key -cert key.crt -crldays 35 -out $2_$3.crl
+    TZ=UTC LD_PRELOAD="$(findLibfaketime)" FAKETIME="${year}-${month}-01 00:00:00" openssl ca -gencrl -config "$BASE/../selfsign.config" -keyfile key.key -cert key.crt -crldays 35 -out $2_$3.crl
     popd > /dev/null
 }
 
@@ -21,7 +21,7 @@ generateCRLs (){ #name start
     [[ "$2" == "" ]] && start=$(echo {01..12})
     [[ "$2" == "07" ]] && start=$(echo {07..12})
     for month in $start; do
-       generateCRL "$1" "$year" "$month"
+        generateCRL "$1" "$year" "$month"
     done
 }
 
@@ -29,26 +29,20 @@ generateYearCRLs (){ #name idx
     [[ "$2" == "1" ]] && start=$(echo {01..12})
     [[ "$2" == "2" ]] && start=$(echo {07..12})
     for month in $start; do
-       generateCRL "$1" "$year" "$month"
+        generateCRL "$1" "$year" "$month"
     done
     [[ "$2" == "1" ]] && start=$(echo {01..12})
     [[ "$2" == "2" ]] && start=$(echo {01..12})
     for month in $start; do
-       generateCRL "$1" "$((year+1))" "$month"
+        generateCRL "$1" "$((year+1))" "$month"
     done
     [[ "$2" == "1" ]] && return
     [[ "$2" == "2" ]] && start=$(echo {01..06})
     for month in $start; do
-       generateCRL "$1" "$((year+2))" "$month"
+        generateCRL "$1" "$((year+2))" "$month"
     done
 }
 generateCRLs root
-for ca in $STRUCT_CAS; do
+for ca in "${STRUCT_CAS[@]}"; do
     generateCRLs $ca
 done
-
-for i in ${TIME_IDX}; do
-generateYearCRLs $year/ca/env_${year}_$i $i
-generateYearCRLs $year/ca/env_${year}_$i $i
-
-done