Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
…ist from the mdq-beta server
1 contributor

Users who have contributed to this file

executable file 28 lines (22 sloc) 588 Bytes
#!/bin/bash
NOW=`date -u "+%Y%m%dT%H%M%S"`
DIR="/home/htdocs/www.incommonfederation.org/federation/metadata_global"
TARGET="${DIR}/entity-list-mdq-beta-${NOW}.json"
SOURCE="${DIR}/entity-list-mdq-beta.json"
URL="http://mdq-beta.incommon.org/global/x-entity-list"
cleanup() {
count=`ls ${DIR}/entity-list-mdq-beta-*T*.json | wc -l`
if [[ $count -ge 5 ]]
then
for f in `ls ${DIR}/entity-list-mdq-beta-*T*.json |head -n $(($count - 3))`
do
rm $f
done
fi
}
cleanup
/usr/bin/curl -s ${URL} -o ${TARGET}
if [[ $? == 0 ]]
then
ln -fs ${TARGET} ${SOURCE}
fi