Skip to content

Commit

Permalink
Update manual.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny096317 authored Jan 26, 2024
1 parent e5ca88a commit 88271ea
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,19 @@ jobs:
sourcefile='.github/source.json'
array_length=$(jq '. | length' ${sourcefile})
echo ${array_length}
crlfile="https://moeaca.nat.gov.tw/repository/MOEACA/CRL/complete.crl"
#for ((i = 0; i < ${array_length}; i++)); do
#crlfile=$(cat ${sourcefile} | jq ".[$i].url" | sed 's/"//g')
for ((i = 0; i < ${array_length}; i++)); do
crlfile=$(cat ${sourcefile} | jq ".[$i].url" | sed 's/"//g')
wget $crlfile -O complete.crl
filename=$(cat ${sourcefile} | jq ".[6].file" | sed 's/"//g')
filename=$(cat ${sourcefile} | jq ".[$i].file" | sed 's/"//g')
openssl crl -nameopt utf8 -inform DER -text -in complete.crl
openssl crl -nameopt utf8 -inform DER -text -in complete.crl | grep "Serial Number" && cut -d " " -f 7 > temp
echo $?
openssl crl -nameopt utf8 -inform DER -text -in complete.crl | grep "Serial Number" | awk '{print $3}' > temp
awk -v RS= '/----/{next}{gsub(/\n/,"\",\"")}BEGIN{printf "\""}7' temp > temp2
SN="$(cat temp2)\""
version=$(openssl crl -nameopt utf8 -inform DER -text -in complete.crl | awk '/X509v3 CRL Number:/ {getline; gsub(/^[ \(/^[ \t]+|[ \t]+$/, ""); print}')
printf "{\"version\":\"$version\", \"value\":[$SN]}" > temp3
cat temp3 | jq > ${filename}
rm temp temp2 temp3 complete.crl
#done
done
date '+%Y-%m-%d %H:%M.%S' > .github/last_executed.txt
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
Expand Down

0 comments on commit 88271ea

Please sign in to comment.