Skip to content

Instantly share code, notes, and snippets.

@unconfigured
Created December 27, 2015 22:53
Show Gist options
  • Save unconfigured/681922160334ab0c0b58 to your computer and use it in GitHub Desktop.
Save unconfigured/681922160334ab0c0b58 to your computer and use it in GitHub Desktop.
Small script to download all Patches available for a specific version of XenServer (see build-number)
#!/bin/sh
[ -f updates.xml ] && rm -f updates.xml
wget http://updates.xensource.com/XenServer/updates.xml
for x in `cat updates.xml | sed -n '/build-number="90233c"/,/version/p' | grep uuid | cut -d'"' -f2`; do url=`grep $x updates.xml | sed -n 's/<patch\(.*\)>[ ]*$/\1/p' | sed -n 's/.*patch-url=.\(.[^"]*\).*/\1/p'`; wget -O `basename $url` -nc "$url"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment