#! /bin/sh set -e certroot=$(cd ${0%/*}/..; pwd) cd "$certroot" . lib/func.sh runas_ca badness=0 indices="byhash byserial" for i in $indices; do rm -rf index/$i; done for i in $indices; do mkdir index/$i.new; done for i in certs/*.cert; do linkserial "$i" .new linkhash "$i" .new done for i in $indices; do if [ -d index/$i ]; then mv index/$i index/$i.old; fi; done for i in $indices; do mv index/$i.new index/$i; done for i in $indices; do rm -rf index/$i.old; done