#! /bin/bash # # Download the geometries from repo.nd280.org/nd280files/geometry using # wget. This is run without arguments. function finish(){ echo ------ End of geometry fetching ------- } echo ------ Start of geometry fetching ------- # The location of the input files. if [ ${GEOMFILES}x == x ]; then GEOMFILES=http://repo.nd280.org/nd280files/geometry/ fi # This directory should ALWAYS exist, but check anyway. if [ ! -d ${OAEVENTROOT} ]; then echo comet-get-geometry: oaEvent directory is missing! echo where is: ${OAEVENTROOT} finish exit 1 fi cd ${OAEVENTROOT} # This directory won't exist when the package is checkout the first time. if [ ! -d ${OAEVENTROOT}/${OAEVENTCONFIG} ]; then mkdir ${OAEVENTCONFIG} fi cd ${OAEVENTCONFIG} # Get an index of geometry files. wget -q -T 5 -t 2 -S -N ${GEOMFILES} -o /dev/null if [ ! -f index.html ]; then echo comet-get-geometry: Cannot check for new geometries. finish exit 1 fi # Build a list of the files download. cat index.html | \ egrep 'geom-[[:xdigit:]]{8}-[[:xdigit:]]{8}-[[:xdigit:]]{8}-[[:xdigit:]]{8}' | \ sed 's/