#!/bin/sh set -e LC_ALL=C export LC_ALL echo echo Generating certificates. rm -f cert.tmp mangle_unprintable_command="`../intl/mangle-unprintable`" ( echo '/* Automatically generated by certs/gen */' echo echo 'static_const struct {' echo ' int len;' echo ' const char *data;' echo '} certificates[] = {' total=`wc -l links.crt | sed 's/^ *//' | sed 's/ .*//'` line=0 while read x; do line=`expr $line + 1` if echo "$x" | grep ^----- >/dev/null; then if echo "$x" | grep ^-----END >/dev/null; then printf "`expr $line \* 100 / $total || true`%%\r" 1>&2 base64 --decode cert.bin printf "{ `wc -c cert.bin|sed 's/^ *//'|sed 's/ .*//'`, \"" # hexdump -v >cert.tmp fi done ../certs.inc echo echo Done. echo