eid-ops/natmd-test-common/overlay/opt/mdqp/pre.d/10-fetching-metadata

18 lines
417 B
Bash
Executable file

#!/usr/bin/env bash
set -e
# Verify and update the repo. Previously run by cron but to mitigate/remove
# race condion it moved here.
cd /var/cache/metadata_r1.komreg.net && make update
cd /opt/metadata
incoming_dir=/opt/mdqp/work/incoming_metadata
mkdir -p ${incoming_dir}
tmp_dir=$(mktemp -d)
rsync -a test-idp/*.xml test-sp/*.xml ${tmp_dir}/
rsync -a --delete ${tmp_dir}/ ${incoming_dir}/
rm -rf "${tmp_dir}"