Apply format change to cert_generator.sh

This commit is contained in:
Jan Andre Ikenmeyer 2019-05-08 19:24:32 +02:00
parent 3d4fbef737
commit fdf48f02c0
No known key found for this signature in database
GPG key ID: 28F9E42748DD95AE

View file

@ -13,12 +13,12 @@ set -o pipefail
# and processed with awk. # and processed with awk.
# 2. Rows end with `"\n`. # 2. Rows end with `"\n`.
# 3. Each row is split by ^" and "," into columns. # 3. Each row is split by ^" and "," into columns.
# 4. Single and double quotes are removed from column 30. # 4. Single and double quotes are removed from column 32.
# 5. If column 13 (12 in the csv file) contains `Websites` # 5. If column 13 (12 in the csv file) contains `Websites`
# (some are Email-only), column 30 is printed, the raw certificate. # (some are Email-only), column 32 is printed, the raw certificate.
# 6. All CA certs trusted for Websites are stored into the `certs` file. # 6. All CA certs trusted for Websites are stored into the `certs` file.
url="https://ccadb-public.secure.force.com/mozilla/IncludedCACertificateReportPEMCSV" url="https://ccadb-public.secure.force.com/mozilla/IncludedCACertificateReportPEMCSV"
curl "${url}" -sSf | gawk -v RS="\"\n" -F'","|^"' \ curl "${url}" -sSf | gawk -v RS="\"\n" -F'","|^"' \
'{gsub("\047","",$(30));gsub("\"","",$(30));if($(13)~/Websites/)print $(30)}' \ '{gsub("\047","",$(32));gsub("\"","",$(32));if($(13)~/Websites/)print $(32)}' \
> certs > ../resources/certs