#!/bin/bash

# script/sync-crls: update the DOD CRLs and place them where authnid expects them
set -e
cd "$(dirname "$0")/.."

mkdir -p crl-tmp
pipenv run python ./atst/domain/authnid/crl/util.py crl-tmp crl
mkdir -p crl
rsync -rq --min-size 400 crl-tmp/. crl/.
rm -rf crl-tmp

if [[ $FLASK_ENV != "prod" ]]; then
  # place our test CRL there
  cp ssl/client-certs/client-ca.der.crl crl/
fi
