diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/pull-and-verify.sh | 25 | ||||
-rwxr-xr-x | scripts/update-cron.sh | 2 |
2 files changed, 17 insertions, 10 deletions
diff --git a/scripts/pull-and-verify.sh b/scripts/pull-and-verify.sh index 1e467010..0cfb22c3 100755 --- a/scripts/pull-and-verify.sh +++ b/scripts/pull-and-verify.sh @@ -1,9 +1,4 @@ -#!/bin/bash - -function die() { - echo $* - exit 1 -} +#!/bin/bash -x URL=$1 DIR=$2 @@ -16,12 +11,24 @@ else fi TMPF=`mktemp` -curl -s -m 120 -k -L $URL > $TMPF || die "Unable to download $URL: $?" +curl -s -m 120 -k -L $URL > $TMPF +if [ $? -ne 0 ]; then + echo "Unable to download $URL: $?" + exit 1 +fi if [ "x$CERT" != "x" ]; then - samlsign -c $CERT -f $TMPF || die "Unable to verify $URL with $CERT: $?" + samlsign -c $CERT -f $TMPF + if [ $? -ne 0 ]; then + echo "Unable to verify $URL with $CERT: $?" + exit 1 + fi fi TMPD=`mktemp -d` -xsltproc --stringparam output $TMPD xslt/import-metadata.xsl $TMPF || die "Unable to import metadata from $URL: $?" +xsltproc --stringparam output $TMPD xslt/import-metadata.xsl $TMPF +if [ $? -ne 0 ]; then + echo "Unable to import metadata from $URL: $?" + exit 1 +fi rsync -avz $TMPD/ $DIR ( echo '<?xml version="1.0"?>' diff --git a/scripts/update-cron.sh b/scripts/update-cron.sh index 8c076a93..6f5925ef 100755 --- a/scripts/update-cron.sh +++ b/scripts/update-cron.sh @@ -7,7 +7,7 @@ update() echo echo "make aggregate" - #make aggregate || return $? + make aggregate || return $? echo echo "make (2007)" |