make-ca: guard overrides on first run.

Closes #17.
This commit is contained in:
DJ Lucas 2021-09-13 21:50:21 -05:00
parent c22c228e3e
commit c3620b3636

13
make-ca
View File

@ -795,11 +795,14 @@ done
unset tempfile unset tempfile
# Backup any anchors with PKIX extensions - any object-id that is not 2.5.29.37 # Backup any anchors with PKIX extensions - any object-id that is not 2.5.29.37
mkdir -p ${TEMPDIR}/override # only do if anchordir already exists
for file in $( grep -r "^object-id: 2\.5\.29\.[0-9]" "${ANCHORDIR}" | \ if test -d "${DESTDIR}${ANCHORDIR}"; then
grep -v "2\.5\.29\.37" | cut -d ":" -f 1); do mkdir -p ${TEMPDIR}/override
cp "${file}" "${TEMPDIR}/override/" for file in $( grep -r "^object-id: 2\.5\.29\.[0-9]" "${DESTDIR}${ANCHORDIR}" | \
done grep -v "2\.5\.29\.37" | cut -d ":" -f 1); do
cp "${file}" "${TEMPDIR}/override/"
done
fi
# Install anchors in $ANCHORDIR # Install anchors in $ANCHORDIR
if test -d "${DESTDIR}${ANCHORDIR}"; then if test -d "${DESTDIR}${ANCHORDIR}"; then