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 25, 2024
1 parent 4c0e194 commit f37689a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run script file
run: |
sudo apt install -y jq
sourcefile='.github/source.json'
array_length=$(jq '. | length' $sourcefile)
for ((i = 0; i < $array_length; i++)); do
crlfile=$(cat $sourcefile | jq ".[$i].url" | sed 's/"//g')
wget $crlfile
filename=$(cat $sourcefile | jq ".[$i].file" | sed 's/"//g')
array_length=$(jq '. | length' ${sourcefile})
for ((i = 0; i < ${array_length}; i++)); do
crlfile=$(cat ${sourcefile} | jq ".[$i].url" | sed 's/"//g')
wget ${crlfile}
filename=$(cat ${sourcefile} | jq ".[$i].file" | sed 's/"//g')
openssl crl -nameopt utf8 -inform DER -text -in complete.crl | grep "Serial Number" | cut -d " " -f 7 > 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]}" > $filename
printf "{\"version\":\"$version\", \"value\":[$SN]}" > ${filename}
rm temp temp2 complete.crl
done
date '+%Y-%m-%d %H:%M.%S' > .github/last_executed.txt
Expand Down

0 comments on commit f37689a

Please sign in to comment.