#!/bin/bash

curl https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/karaf/0.8.0-SNAPSHOT/maven-metadata.xml > maven-metadata.xml

EXT=`awk -vRS="</value>" '{gsub(/.*<value.*>/,"");print}' maven-metadata.xml | sed -n 1p`
EXT=${EXT%$'\n'}
wget https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/karaf/0.8.0-SNAPSHOT/karaf-$EXT.zip
rm maven-metadata.xml
