diff --git a/README.md b/README.md index 382a966..a72f1d8 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,17 @@ # inc-md-js ## InCommon Metadata-Driven Web Pages + This produces the web pages found at: -<p>https://incommon.org/federation/info/all-entities.html</p> -and -<p>https://incommon.org/federation/info/all-entities-mdq-beta.html</p> -It depends on a JSON feed of metadata produced by: -<p>https://github.internet2.edu/InCommon/inc-md-json</p> -At deploy-time, the symlink from 'metadata' needs to point to /usr/local/pkg/metadriven/metadata on the web server, which is where the JSON metadata files are maintained +https://incommon.org/federation/info/all-entities.html and +https://incommon.org/federation/info/all-entities-mdq-beta.html. + + +The all-entities.html page depends on a JSON feed of metadata produced by: +[https://github.internet2.edu/InCommon/inc-md-json](https://github.internet2.edu/InCommon/inc-md-json). +At deploy-time, the symlink from 'metadata' needs to point to +/usr/local/pkg/metadriven/metadata on the web server, which is where the JSON +metadata files are maintained. + + +The all-entities-mdq-beta.html depends on a JSON feed downloaded from +[http://mdq-beta.incommon.org/global/x-entity-list](http://mdq-beta.incommon.org/global/x-entity-list). diff --git a/bin/get_mdq_entity_list.sh b/bin/get_mdq_entity_list.sh new file mode 100755 index 0000000..1329460 --- /dev/null +++ b/bin/get_mdq_entity_list.sh @@ -0,0 +1,28 @@ +#!/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 +