OUT=$(curl -s "http://$HOST:$PORT/vivisimo/cgi-bin/velocity?v.username=$USER&v.password=$PWD&v.function=search-collection-list-xml&v.indent=true&v.app=api-rest")
echo $OUT > out2
COLLIST=$(xmllint --xpath "//vse-collection[starts-with(@name,'mycollection')]/@name" out2 | sed 's/name="//g' | sed 's/"//g')
COLLIST will return all collections which start with "mycollection"
You can further work on the list by using the following as an example:
for col in $COLLIST; do
getStatusFunction $col $PORT
done
No comments:
Post a Comment